[1.11.5] Problem with HLMS PBR on D3D9 Topic is solved

Problems building or running the engine, queries about how to use features etc.
Post Reply
FloydPepper
Gnoblar
Posts: 9
Joined: Tue May 22, 2018 1:58 pm
Location: France
x 1

[1.11.5] Problem with HLMS PBR on D3D9

Post by FloydPepper »

Ogre Version: 1.11.5
Operating System: Windows 10
Render System: D3D9

Hello,

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 !
paroj
OGRE Team Member
OGRE Team Member
Posts: 1995
Joined: Sun Mar 30, 2014 2:51 pm
x 1075
Contact:

Re: [1.11.5] Problem with HLMS PBR on D3D9

Post by paroj »

the texCUBElod function used here
https://github.com/OGRECave/ogre/blob/v ... #L368-L372

seems not to work correctly with D3D9. The strage thing is that the same shader works fine with D3D11.
FloydPepper
Gnoblar
Posts: 9
Joined: Tue May 22, 2018 1:58 pm
Location: France
x 1

Re: [1.11.5] Problem with HLMS PBR on D3D9

Post by FloydPepper »

Thank you for your reply.

That's what I thought. Do you have any idea of a workaround ?
FloydPepper
Gnoblar
Posts: 9
Joined: Tue May 22, 2018 1:58 pm
Location: France
x 1

Re: [1.11.5] Problem with HLMS PBR on D3D9

Post 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 : https://gpuopen.com/archive/gamescgi/cubemapgen/
It can be used in offline to generate correctly interpolated env maps.
Post Reply