Ogre Version: :1.12:
Operating System: :Windows 10:
Render System: :DirectX 9:
I just updated our application with the 1.12 version (thanks for the support of #include with glsl, it is much appreciated) and it seems there is an issue with the DX9 render system.
We got simple materials: texture 1D or 2D, lit or not, using the fixed pipeline.
When the lighting is enabled, with DX9, the texture becomes all black but is still lighted.
If I disable the lighting, the render is correct.
If I use the opengl rendersystem, all renders are ok.
And of course it was correctly rendered with 1.11.5.
DX9 without lighting, render is ok
DX9 with lighting enabled, render is not ok
opengl with lighting enabled, render is ok.
Regards
[1.12] DirectX 9 + lighting gives black texture
-
- Gnoblar
- Posts: 4
- Joined: Fri May 10, 2019 8:17 am
- x 3
-
- OGRE Team Member
- Posts: 1995
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1075
- Contact:
Re: [1.12] DirectX 9 + lighting gives black texture
can you reproduce the issue with any of the samples? Or alternatively provide a simple scene to reproduce it?
Also please try 1.11.6 as it will help narrowing down the offending change.
Also please try 1.11.6 as it will help narrowing down the offending change.
-
- Gnoblar
- Posts: 4
- Joined: Fri May 10, 2019 8:17 am
- x 3
Re: [1.12] DirectX 9 + lighting gives black texture
I'm building with 1.11.6 to check the results.
In the meantime, I found out it seems to be related to the light and not the texture. If I switch to a spotlight, I got the following:
instead of
The dark area should be lighted.
So it seems I got a black light instead of a coloured one.
I'm rechecking the light configuration but it seems ok.
In the meantime, I found out it seems to be related to the light and not the texture. If I switch to a spotlight, I got the following:
instead of
The dark area should be lighted.
So it seems I got a black light instead of a coloured one.
I'm rechecking the light configuration but it seems ok.
-
- Gnoblar
- Posts: 4
- Joined: Fri May 10, 2019 8:17 am
- x 3
Re: [1.12] DirectX 9 + lighting gives black texture
Ok, seems I found out the issue:
The variable d3dLight is configured from the shaders parameters.
But the d3dLight.ambient variable is never configured. So it is left unitialised with random value and incorrect.
In 1.11.5 it was set to 0 with ZeroMemory().
If I set the d3dLight.ambient to 0, the display is ok.
Code: Select all
void D3D9RenderSystem::applyFixedFunctionParams(const GpuProgramParametersSharedPtr& params, uint16 mask)
{
D3DMATERIAL9 material;
[b] D3DLIGHT9 d3dLight;[/b]
...
}
But the d3dLight.ambient variable is never configured. So it is left unitialised with random value and incorrect.
In 1.11.5 it was set to 0 with ZeroMemory().
If I set the d3dLight.ambient to 0, the display is ok.
-
- Gnoblar
- Posts: 4
- Joined: Fri May 10, 2019 8:17 am
- x 3