clover-moe/spearmint

Raven tcGen environment

Opened this issue · 0 comments

Elite Force (SP&MP), JK2 (SP), and JA (SP) (and maybe SoF2 SP or MP?) have a different tcGen environment than Quake 3. I also need to review first person view weapon. clover-moe/lilium-voyager@6ab1492 and clover-moe/lilium-voyager@0f4e16f.

I confirmed Quake 3 1.16n has the same behavior as Quake 3 1.32 but I haven't tested pre-release Quake 3 builds yet. I want to confirm whether this is a Raven Software change or pre-release Quake 3 hang over before adding this. I should probably also look at the different tcGen environment in American McGee's Alice again as well.

The method used in Elite Force requires the sphere map image to be centered at top-left corner instead of the center of the image and also flipped vertically. This may of been done to reduce math involved. Elite Force also changes the reflection to appear better on floors while Quake 3 appears better on walls. It might be nice if these could be controlled separate.

Add a cvar to control the default tcGen environment behavior and additional keywords for tcGen environment <id|raven|matrix> with matrix having additional parameters for ( sx sy sz so ) ( tx ty tz to )?

  • tcGen environment id would be equal to tcGen environment matrix ( 0 0.5 0 0.5 ) ( 0 0 -0.5 0.5 ).
  • tcGen environment raven would be equal to tcGen environment matrix ( 0.5 0 0 0 ) ( 0 0.5 0 0 ).
s = dot( reflected, ( sx sy sz ) ) + so;
t = dot( reflected, ( tx ty tz ) ) + to;

If support it was going to be added in Lilium Voyager as well (which I'm not committed to), it would need to be a single token for tcGen so that original renderer would just print a warning it instead of failing to load the shader. Though matrix with additional parameters couldn't be used.

For example:

shader
{
    {
        map env.tga
        tcGen environment
        tcGen environment_id // override 'environment' with id Software's behavior if supported
    }
}