Post

"Interesting" new bug with OpenGL and GLSL : I have a piece of code that determines the shadow cascade to use from a world position. I found something weird so made a minimal example. Here are the two results if I use a loop or if I unroll the loop:

The whole code basically just takes the world position and multiplies it with the view matrix to get the view position, calculates the cascade index, and, if the cascade index is 0, it's red, if it's 1, it's green and if it's 2, it's blue. The unroll version is the correct one.

Someone on the Vulkan Discord suggested to reverse the loop... And it worked!

0 reposts1 like