ioquake / ioq3

The ioquake3 community effort to continue supporting/developing id's Quake III Arena
https://www.ioquake3.org/
GNU General Public License v2.0
2.34k stars 523 forks source link

OpenGL2: Lightmap as an environment map renders incorrect with r_mergeLightmaps 1 #636

Closed zturtleman closed 4 months ago

zturtleman commented 4 months ago

In q3dm0, the blue monitor above the crosshair is incorrect in OpenGL2 with r_mergeLightmaps 1.

opengl1 renderer: (OpenGL2 looks similar with r_mergeLightmaps 0.) shot0048

OpenGL2 renderer: shot0049

The shader textures/base_wall/comp3c shader uses a stage:

        {
        map $lightmap
                tcGen environment
                blendFunc GL_ONE GL_ONE
    }

r_mergeLightmaps 1 combines the lightmaps. It would be closer if offset texcoords like in https://github.com/ioquake/ioq3/commit/ae0878ca618a737d7f8e843e8f4867bd34712cbe but tcGen environment will repeat and access other lightmaps.

zturtleman commented 4 months ago

It would be closer if offset texcoords like in https://github.com/ioquake/ioq3/commit/ae0878ca618a737d7f8e843e8f4867bd34712cbe but tcGen environment will repeat and access other lightmaps.

Never mind, offsetting it should be fine. tcGen environment is a sphere map; it doesn't pan outside of the 0.0 to 1.0 range.