Page 1 of 1

[1.11.5] Problem with HLMS PBR on D3D9

Posted: Thu May 02, 2019 9:01 am
by FloydPepper
Ogre Version: 1.11.5
Operating System: Windows 10
Render System: D3D9


I have a problem with the HLMS PBR on Direct 3D 9: whatever roughness value I use for my material, my environment map reflection is always appearing like if the roughness was set to 0. I mean that the reflection of the env map isn't blurred at all (the env map mipmap level used seems to be the one with the highest resolution).

This problem only appears on nVidia cards, no problems with intel intregrated chipset. Also, there is no problem with OpenGL.
I have check the 1.11.6 release notes, but there is no mention of this.

Any ideas of the problem ?

Thank you !

Re: [1.11.5] Problem with HLMS PBR on D3D9

Posted: Thu May 02, 2019 10:11 pm
by paroj
the texCUBElod function used here ... #L368-L372

seems not to work correctly with D3D9. The strage thing is that the same shader works fine with D3D11.

Re: [1.11.5] Problem with HLMS PBR on D3D9

Posted: Fri May 03, 2019 1:24 pm
by FloydPepper
Thank you for your reply.

That's what I thought. Do you have any idea of a workaround ?

Re: [1.11.5] Problem with HLMS PBR on D3D9

Posted: Mon May 13, 2019 1:42 pm
by FloydPepper
I found a solution.
I figured out that the result on each individual face was correct (uses the good mipmap level depending of the roughness). The problem is that these resulting faces do not take into account the neighboring faces.

In fact, it seems that in D3D9 some graphic cards do not support interpolation between the env map faces. So the result of texCUBElod could be different depending of the hardware.

To fix that, there is this tool :
It can be used in offline to generate correctly interpolated env maps.