TextureRenderer fullscreen quad with half screen dimensions problem

I'm running into problems when rendering a fullscreen quad with TextureRenderer with a width and height which is half the size of the display.  I need to do this for performance.



First I render the scene to a texture,

then I apply that texture to the fullscreen quad,

then I render the fullscreen quad to another texture,

then I apply that texture to the fullscreen quad and render it with the normal renderer.



The final result is scaled to twice the size it should be.



Anyone have any clues of what I'm doing wrong?

i didn't use texture renderer for some time, but can't you just:

  • render the scene with a resolution half of the current
  • and apply the texture to the fullscreen quad ?


Thanks!


Core-Dump said:

but can't you just:
- render the scene with a resolution half of the current


How is that done? I thought that was what I was doing:

tRenderer = display.createTextureRenderer(
                display.getWidth() / renderScale,
                display.getHeight() / renderScale,
                TextureRenderer.Target.Texture2D);

In the copyToTexture function you can specify width and height, but I need to use the render(Spatial, Texture) method in TextureRenderer.

I copied alot of stuff from BloomRenderPass, and there is no such problem, but I can't figure out what makes it work.

Though, I have noticed that in the custom shaders that are being used every time a render to texture is done of a fullScreenQuad,  the texture coordinates are being processed. Could that be the difference?

I'll try making a shader that only does the texturecoord processing.

Woohoo! That worked!!



So when you are going to render a fullscreen quad with a TextureRenderer which you have created with dimensions other than those of the display, use a custom shader with the same texture coordinate processing as bloom_final shader of BloomRenderPass.



Again and again it's proved that sometimes all you need is a good nights sleep!

cool, glad you figured it out.

Rik said:

Woohoo! That worked!!

So when you are going to render a fullscreen quad with a TextureRenderer which you have created with dimensions other than those of the display, use a custom shader with the same texture coordinate processing as bloom_final shader of BloomRenderPass.

Again and again it's proved that sometimes all you need is a good nights sleep!


i dont know why you would use a shader for rendering a scene to a texture. take a look at ImposterNode.