Ogre Version: 1.12.12
Operating System: Win10 x64
Render System: Direct3D 11
Hi all
I just updated ogre from 1.10.12 to 1.12.12 and have different pictures.
On the left side 1.12.12 on the right 1.10.12. As you can see specular is wider on the left.
How I can achieve same results as in 1.10.12?
After update I got errors about ffp and advice to use custom shaders or RTSS. I used RTSS, thus for each material I
used ShaderGenerator::createShaderBasedTechnique().
Specular different after Ogre update
-
- Gnoblar
- Posts: 11
- Joined: Fri Aug 21, 2020 11:14 am
-
- OGRE Team Member
- Posts: 1994
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1074
- Contact:
Re: Specular different after Ogre update
you were using D3D9 with 1.10 I guess?
try switching to FFP lighting as described here:
https://ogrecave.github.io/ogre/api/lat ... custom_api
try switching to FFP lighting as described here:
https://ogrecave.github.io/ogre/api/lat ... custom_api
-
- Gnoblar
- Posts: 11
- Joined: Fri Aug 21, 2020 11:14 am
Re: Specular different after Ogre update
No, I used D3D11 in 1.10 too.paroj wrote: ↑Mon May 31, 2021 12:05 pm you were using D3D9 with 1.10 I guess?
try switching to FFP lighting as described here:
https://ogrecave.github.io/ogre/api/lat ... custom_api
I tried switching to FFP but now get exception somewhere in Ogre.
FFP not a direct reason, we used RTSS perpixel on 1.10 too.
Maybe Ogre shader libs and/or c++ code changed in part of lightning.
-
- Gnoblar
- Posts: 11
- Joined: Fri Aug 21, 2020 11:14 am
Re: Specular different after Ogre update
I don't know is this a bug in SGXLib_PerPixelLighting.glsl in SGX_Light_Directional_DiffuseSpecular method.
Light direction (vNegLightDirView parameter) not normalized. So user must pass normalised direction of light.
Light direction (vNegLightDirView parameter) not normalized. So user must pass normalised direction of light.
-
- OGRE Team Member
- Posts: 1994
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1074
- Contact:
Re: Specular different after Ogre update
yes that parameter should be normalised. The light direction is unit length, but it is transformed by the view matrix, that can introduce scaling.
Does adding a "normalise" call fix the rendering for you?
Does adding a "normalise" call fix the rendering for you?
-
- Gnoblar
- Posts: 11
- Joined: Fri Aug 21, 2020 11:14 am
Re: Specular different after Ogre update
Light direction not transforming in vertex shader (I see that from dumped shader generated by RTSS). And yes, passing normalised direction helped me.
-
- OGRE Team Member
- Posts: 1994
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1074
- Contact:
Re: Specular different after Ogre update
the light direction is transformed on CPU.
This should be the proper fix:
https://github.com/OGRECave/ogre/pull/2055/files
This should be the proper fix:
https://github.com/OGRECave/ogre/pull/2055/files
-
- Gnoblar
- Posts: 11
- Joined: Fri Aug 21, 2020 11:14 am
Re: Specular different after Ogre update
Nice commit, but I didn't see where light dir normalized in it. And question, why light direction transformed? Blinn-phong shading acts in world space as far as know, not in view space.paroj wrote: ↑Mon May 31, 2021 5:51 pm the light direction is transformed on CPU.
This should be the proper fix:
https://github.com/OGRECave/ogre/pull/2055/files
-
- OGRE Team Member
- Posts: 1994
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1074
- Contact:
Re: Specular different after Ogre update
the direction is normalised inside ACT_LIGHT_DIRECTION_VIEW_SPACE.
Doing lighting in view space avoid precision issues, if both camera and light are far from origin.
Doing lighting in view space avoid precision issues, if both camera and light are far from origin.
-
- Gnoblar
- Posts: 11
- Joined: Fri Aug 21, 2020 11:14 am