Blue Marble - To Guy Allard
by Matt Huston · in Torque Game Engine Advanced · 07/24/2008 (7:43 am) · 3 replies
This message is mostly for Guy Allard who wrote the Blue Marble demo available on his blog. He said that he would post the Atmosphere change code to the private forums somewhere but I can't seem to find those changes.
I had tried to email a couple times in the last week regarding the Atmosphere Shader. I notice you have created a new shader constant called VC_EYE_POS2 and you said that it was eye-pos with scale and I am not very sure what that exactly means.
Any help would be appreciated.
I had tried to email a couple times in the last week regarding the Atmosphere Shader. I notice you have created a new shader constant called VC_EYE_POS2 and you said that it was eye-pos with scale and I am not very sure what that exactly means.
Any help would be appreciated.
About the author
www.atomicbanzai.com
Torque Owner Guy Allard
Default Studio Name
The atmosphere shader needs a slightly different eye position supplied to it in order to render correctly. To do this, I made a shader constant called VC_EYE_POS2. To get this passed to the shaders, there's a couple of small changes to be made to the engine.
File: materials\processedShaderMaterial.cpp
function: setEyePosition(MatrixF objTrans, Point3F position, U32 pass)
before line: position.convolveInverse(objTrans.getScale());
add:
Then to make the shaders aware of this, you need to edit both of your shdrconsts.h files (one lives in game\shaders, and the other lives in game, no idea why there's 2) and assign a register to VC_EYE_POS2, e.g.
In the first section of the file,
After: #define VC_CUBE_TRANS C16
add: #define VC_EYE_POS2 C18
and then in the #else section
After: #define VC_CUBE_TRANS 16
#define VC_EYE_POS2 18
I think that's it. Hope it helps!