Specular cubemap inverted?

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


Post Reply
User avatar
miki3d
Halfling
Posts: 56
Joined: Wed Jul 18, 2012 1:30 pm
Location: Italy
x 4

Specular cubemap inverted?

Post by miki3d »

Hi all!

It seems that the specular cubemap is inverted into the shader.
As you can see on the screenshot we inverted our env to match it.

Image

Tnx :)
Image
Co-Founder and Design Director at VaeVictis
Current project Racecraft
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

Re: Specular cubemap inverted?

Post by xrgo »

yes it is... I solved this problem by doing this:

Code: Select all

....
		vec3 cubeMapCoord = reflDir * pass.invViewMatCubemap;
		cubeMapCoord.z = -cubeMapCoord.z;
		vec3 envColourS = textureLod( texEnvProbeMap, cubeMapCoord,....
I think this should be fixed in another way, maybe "invViewMatCubemap" is incorrect?
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5299
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1280
Contact:

Re: Specular cubemap inverted?

Post by dark_sylinc »

xrgo wrote:I think this should be fixed in another way, maybe "invViewMatCubemap" is incorrect?
The most efficient way is to flip the sign of invViewMatrix3.m[2][0], invViewMatrix3.m[2][1] & invViewMatrix3.m[2][2] in OgreHlmsPbs.cpp

If it looks bad, then what I told you was wrong, and you have to flip the sign of invViewMatrix3.m[0][2], invViewMatrix3.m[1][2] & invViewMatrix3.m[2][2]. I always confuse row and column major order.
Post Reply