Hello,
I have a LOD system that uses heightmaps generated in a shader. It works fine but I noticed, when profiling the program, that binding a texture to the framebuffer every time a height map is needed was eating up a lot of time. To solve this issue I bind the texture, let’s call it hm1, to the framebuffer at startup. Yet by doing this every time hm1 is written into again all other “hm1 textures” are changed to match the newly written into texture. If that didn’t make sense let me know. I was wondering if anyone had any ideas regarding how to solve this problem. Here is some code if it helps:
At startup:
[java]
HM1 = new Texture2D(itexSize, itexSize, Format.RGBA32F);
fbo1 = new FrameBuffer(itexSize, itexSize, 1);
fbo1.setColorTexture(HM1);
vp1.setOutputFrameBuffer(fbo1); //this is a viewport
[/java]
when a new height map is requested:
[java]
vp1.attachScene(heightmap_quad);
if(vp1.isEnabled()){
heightmap_quad.updateGeometricState();
}
return HM1;
[/java]
Any and all help is appreciated. If I was unclear about anything please notify me.