Tag Info

New answers tagged

0

Your problem is where you commented out glBindFramebuffer(GL_FRAMEBUFFER, 0);. You need to bind to a different FBO there, otherwise you lose everything you just rendered when you call glClear a couple lines down. Because of this reading from and writing to the same FBO texture at once cannot work. You'll need a separate FBO and texture to write to.


0

After a full day of testing and google searching I finally came upon the fix so I'm sharing it here : uniform vec2 Resolution;//This is the render target size, i.e. what you feed into glViewport vec2 screen; screen.x = ( gl_FragCoord.x - Resolution.x / 2.0 ) / ( Resolution.x / 2.0 ); screen.y = ( (Resolution.y - gl_FragCoord.y) - ...


1

Big engines using 'premutation' that make many shaders for every specifited set of material features. But thats not solution for 'deffered' rendering, for deffered rendering you should implement material 'indexes' Indexes will select proper render path, and all material caps. Usualy indexes created in matrial pipeline, when level builds. Small parts of ...


1

You can use a tiny neutral texture to "disable" shader features you're not using which incurs a texture switch penalty but no shader switch penalty. You can generate multiple shaders with all feature combinations and switch to the proper shader, this incurs a shader switch penalty but the simpler shaders execute faster. Which ever is best depends on which ...


2

If I understand your question correctly, you are building and applying the shadow maps at the same time. You really do not want to do that. If you are smart about this, you can vary the frequency of shadow map updates and save massive amounts of memory bandwidth necessary to actually fill the shadow maps (e.g. if nothing in the world moves inside the light ...


0

You can use a cube map for point lights. The cube shadow map might need to be rendered face-by-face as before but the last step can be done as one pass.



Top 50 recent answers are included