[2.1] Bug in non SIMD builds - Forward3D Lights

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
N0vember
Gremlin
Posts: 196
Joined: Tue Jan 27, 2009 12:27 am
x 24

[2.1] Bug in non SIMD builds - Forward3D Lights

Post by N0vember »

Hi !

I'm becoming crazy over this one.

I have an issue where lights seem to be moving with the camera.
The nodes to which the lights are attached are definitely not moving. Only the camera node is moving.
Also the lights seem to be weirdly relative to the four meshes of the four tiles.
I have initialized Forward3D and called collectLights() at least once since the lights were created on the camera that is moving.
I checked the normals because I had a weirdly similar issue earlier because of normals but I checked my mesh normals and they are fine.

Any clue to what can be causing this kind of issue ?
move0.png
move1.png
Last edited by N0vember on Mon Jun 12, 2017 1:09 am, edited 1 time in total.
N0vember
Gremlin
Posts: 196
Joined: Tue Jan 27, 2009 12:27 am
x 24

Re: [2.1] Weird moving Lights that souldn't move

Post by N0vember »

I managed to isolate the problem with only one point light and one mesh (the cube).
When the camera moves, the light appears to move.
So I suppose the problem is not how I create and position those, but rather in the camera setup or the forward3D setup ?
N0vember
Gremlin
Posts: 196
Joined: Tue Jan 27, 2009 12:27 am
x 24

Re: [2.1] Weird moving Lights that souldn't move

Post by N0vember »

So I tracked down this issue to the fact that I'm building Ogre "manually", not with CMake (I use a premake fork GENie), and specifically to my CustomBuildSettings.h file.
I found the bug was caused by it missing this line :

Code: Select all

#define OGRE_USE_SIMD 1
I understand this might not be such an important issue since I suppose non SIMD builds almost never happen, but I think there's definitely a bug in there.
When OGRE_USE_SIMD is not set, the Forward3D lights are all fucked up. I suppose this is related to the Array/C implementation.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: [2.1] Bug in non SIMD builds - Forward3D Lights

Post by dark_sylinc »

Ok, you've got my attention :)
Do you have a quick way to reproduce this bug? (I assume you're not mixing an Ogre built with OGRE_USE_SIMD with your app being built without; otherwise lots of weird things will happen).
N0vember
Gremlin
Posts: 196
Joined: Tue Jan 27, 2009 12:27 am
x 24

Re: [2.1] Bug in non SIMD builds - Forward3D Lights

Post by N0vember »

SSE is enabled in the compiler settings for the whole project, but OGRE_USE_SIMD is undefined (so defaulted to 0) for the whole project, both in Ogre and in the code that uses it.
But that in itself shouldn't cause the bug right ?

As to how to reproduce, just creating a mesh (a cube) and a bunch of point lights on one side is enough to get the wrong lighting on my end.
So I suppose any sample with Forward3D point lights would be wrong also, but I wouldn't know because I don't build the samples.
Post Reply