With cordite in the air, splintered steel, shell casings and powder burns, there’s only one explanation...
Discuss & improve the game engine.

Moderators: sparcdr, torhu, Tequila

tcgen environment

Postby Joe Kari » Fri Jan 21, 2011 2:22 am

For your information, I have implemented axis customization for the shader instruction "tcgen environment" in the revision 554.

Now you can specify:
* tcgen environment_X (along the X-axis, the same as tcgen environment)
* tcgen environment_Y (along the Y-axis)
* tcgen environment_Z (along the Z-axis, this one will be really usefull to make reflecting water)
User avatar
Joe Kari
SG Team
 
Posts: 879
Joined: Sun Sep 16, 2007 8:44 pm
Location: France



Postby Joe Kari » Sat Jan 22, 2011 4:36 am

* "tcgen customEnvironment ( vector ) ( normal_weight_vector )" use a custom projection vector, and set custom weight for normals. The first vector will be normalized.

The default "tcgen environment" is equivalent to "tcgen customEnvironment ( 1 0 0 ) ( 2 2 2 )".

Interesting value for normal_weight_vector are:
- ( 0 0 0 ) for a skybox-like environment map
- ( 2 2 2 ) for the default Q3 environment map
- ( 4 4 4 ) for an environment map with more deformation

If you want to cast an env map from a specific point of view, you can adjust the vector... for example, if I want to cast it at 45° (North-East) you can do:
tcgen customEnvironment ( 1 1 0 ) ( 2 2 2 )

The same but toward the bottom too:
tcgen customEnvironment ( 1 1 -1 ) ( 2 2 2 )
User avatar
Joe Kari
SG Team
 
Posts: 879
Joined: Sun Sep 16, 2007 8:44 pm
Location: France




Return to Code

Show Sidebar
Show Sidebar

User Control Panel

cron