Different resolution for render targets?

For my game, I want to have a specular color attachment/render target connected to a texture that is 1/4th the screen resolution, for use as a specular pass which will then be blurred.


What I have to do in my game right now:

1)Set full resolution color and specular buffers as color attachments

2)Render the scene, using MRT output to write to each buffer simultaneously

3)Do another pass with the full resolution specular buffer as an input texture rendered as a full-screen quad, with a 1/4 resolution specular texture as the output.

4)Blur the 1/4 resolution specular texture

5)Do another pass that uses the full resolution color buffer and 1/4 resolution specular buffer as input textures


This wastes a lot of fillrate and involves a bunch of extra tile cache loads & stores.


Is there a way to eliminate Step 3 by just having step 2's specular attachment be the 1/4-resolution specular texture to begin with? I tried this already and while it "worked", *everything* just got rendered at 1/4 resolution and outputted to the upper left 1/4th of the screen.


Or is there another way? This would be a lot simpler if there was a way to do everything in the tile cache like in Apple's deferred shading example, but then I'd have no way to blur the specular pass (unless you can read from pixels in the tile cache other than the current one).

Replies

I encountered similar issue. You could assign textures of different resolution as attachments for the renderPassDescriptor but it seems render area is always limited to be the resolution of smallest of all textures.