layer->color[3] = a;
}
+static float R_EvaluateQ3WaveFunc(q3wavefunc_t func, const float *parms)
+{
+ double index, f;
+ index = parms[2] + r_refdef.time * parms[3];
+ index -= floor(index);
+ switch (func)
+ {
+ default:
+ case Q3WAVEFUNC_NONE:
+ case Q3WAVEFUNC_NOISE:
+ case Q3WAVEFUNC_COUNT:
+ f = 0;
+ break;
+ case Q3WAVEFUNC_SIN: f = sin(index * M_PI * 2);break;
+ case Q3WAVEFUNC_SQUARE: f = index < 0.5 ? 1 : -1;break;
+ case Q3WAVEFUNC_SAWTOOTH: f = index;break;
+ case Q3WAVEFUNC_INVERSESAWTOOTH: f = 1 - index;break;
+ case Q3WAVEFUNC_TRIANGLE:
+ index *= 4;
+ f = index - floor(index);
+ if (index < 1)
+ f = f;
+ else if (index < 2)
+ f = 1 - f;
+ else if (index < 3)
+ f = -f;
+ else
+ f = -(1 - f);
+ break;
+ }
+ return (float)(parms[0] + parms[1] * f);
+}
+
void R_UpdateTextureInfo(const entity_render_t *ent, texture_t *t)
{
int i;
model_t *model = ent->model;
+ float f;
+ float tcmat[12];
// switch to an alternate material if this is a q1bsp animated material
{
t->currentmaterialflags |= MATERIALFLAG_SHORTDEPTHRANGE;
if (ent->flags & RENDER_VIEWMODEL)
t->currentmaterialflags |= MATERIALFLAG_SHORTDEPTHRANGE;
- if (t->currentmaterialflags & MATERIALFLAG_WATER && r_waterscroll.value != 0)
- t->currenttexmatrix = r_waterscrollmatrix;
- else
- t->currenttexmatrix = identitymatrix;
if (t->backgroundnumskinframes && !(t->currentmaterialflags & MATERIALFLAGMASK_DEPTHSORTED))
t->currentmaterialflags |= MATERIALFLAG_VERTEXTEXTUREBLEND;
+ switch(t->tcmod)
+ {
+ case Q3TCMOD_COUNT:
+ case Q3TCMOD_NONE:
+ if (t->currentmaterialflags & MATERIALFLAG_WATER && r_waterscroll.value != 0)
+ t->currenttexmatrix = r_waterscrollmatrix;
+ else
+ t->currenttexmatrix = identitymatrix;
+ break;
+ case Q3TCMOD_ENTITYTRANSLATE:
+ // this is used in Q3 to allow the gamecode to control texcoord
+ // scrolling on the entity, which is not supported in darkplaces yet.
+ Matrix4x4_CreateTranslate(&t->currenttexmatrix, 0, 0, 0);
+ break;
+ case Q3TCMOD_ROTATE:
+ Matrix4x4_CreateTranslate(&t->currenttexmatrix, 0.5, 0.5, 0);
+ Matrix4x4_ConcatRotate(&t->currenttexmatrix, t->tcmod_parms[0] * r_refdef.time, 0, 0, 1);
+ Matrix4x4_ConcatTranslate(&t->currenttexmatrix, -0.5, -0.5, 0);
+ break;
+ case Q3TCMOD_SCALE:
+ Matrix4x4_CreateScale3(&t->currenttexmatrix, t->tcmod_parms[0], t->tcmod_parms[1], 1);
+ break;
+ case Q3TCMOD_SCROLL:
+ Matrix4x4_CreateTranslate(&t->currenttexmatrix, t->tcmod_parms[0] * r_refdef.time, t->tcmod_parms[1] * r_refdef.time, 0);
+ break;
+ case Q3TCMOD_STRETCH:
+ f = 1.0f / R_EvaluateQ3WaveFunc(t->tcmod_wavefunc, t->tcmod_parms);
+ Matrix4x4_CreateFromQuakeEntity(&t->currenttexmatrix, 0.5f * (1 - f), 0.5 * (1 - f), 0, 0, 0, 0, f);
+ break;
+ case Q3TCMOD_TRANSFORM:
+ VectorSet(tcmat + 0, t->tcmod_parms[0], t->tcmod_parms[1], 0);
+ VectorSet(tcmat + 3, t->tcmod_parms[2], t->tcmod_parms[3], 0);
+ VectorSet(tcmat + 6, 0 , 0 , 1);
+ VectorSet(tcmat + 9, t->tcmod_parms[4], t->tcmod_parms[5], 0);
+ Matrix4x4_FromArray12FloatGL(&t->currenttexmatrix, tcmat);
+ break;
+ case Q3TCMOD_TURBULENT:
+ // this is handled in the RSurf_PrepareVertices function
+ t->currenttexmatrix = identitymatrix;
+ break;
+ }
+
t->colormapping = VectorLength2(ent->colormap_pantscolor) + VectorLength2(ent->colormap_shirtcolor) >= (1.0f / 1048576.0f);
t->basetexture = (!t->colormapping && t->currentskinframe->merged) ? t->currentskinframe->merged : t->currentskinframe->base;
t->glosstexture = r_texture_white;
if (rsurface.array_modelvertex3f)
Mem_Free(rsurface.array_modelvertex3f);
rsurface.array_size = (newvertices + 1023) & ~1023;
- base = (float *)Mem_Alloc(r_main_mempool, rsurface.array_size * sizeof(float[31]));
+ base = (float *)Mem_Alloc(r_main_mempool, rsurface.array_size * sizeof(float[33]));
rsurface.array_modelvertex3f = base + rsurface.array_size * 0;
rsurface.array_modelsvector3f = base + rsurface.array_size * 3;
rsurface.array_modeltvector3f = base + rsurface.array_size * 6;
rsurface.array_deformednormal3f = base + rsurface.array_size * 21;
rsurface.array_texcoord3f = base + rsurface.array_size * 24;
rsurface.array_color4f = base + rsurface.array_size * 27;
+ rsurface.array_generatedtexcoordtexture2f = base + rsurface.array_size * 31;
}
void RSurf_CleanUp(void)
rsurface.normal3f = rsurface.modelnormal3f;
rsurface.normal3f_bufferobject = rsurface.modelnormal3f_bufferobject;
rsurface.normal3f_bufferoffset = rsurface.modelnormal3f_bufferoffset;
+ rsurface.texcoordtexture2f = rsurface.modeltexcoordtexture2f;
}
void RSurf_ActiveModelEntity(const entity_render_t *ent, qboolean wantnormals, qboolean wanttangents)
rsurface.normal3f = rsurface.modelnormal3f;
rsurface.normal3f_bufferobject = rsurface.modelnormal3f_bufferobject;
rsurface.normal3f_bufferoffset = rsurface.modelnormal3f_bufferoffset;
+ rsurface.texcoordtexture2f = rsurface.modeltexcoordtexture2f;
}
static const int quadedges[6][2] = {{0, 1}, {0, 2}, {0, 3}, {1, 2}, {1, 3}, {2, 3}};
rsurface.normal3f_bufferobject = rsurface.modelnormal3f_bufferobject;
rsurface.normal3f_bufferoffset = rsurface.modelnormal3f_bufferoffset;
}
+ if (rsurface.texture->tcmod == Q3TCMOD_TURBULENT)
+ {
+ // make turbulent versions of only the texcoords used by the specified surfaces
+ int texturesurfaceindex;
+ float amplitude = rsurface.texture->tcmod_parms[1];
+ float animpos = rsurface.texture->tcmod_parms[2] + r_refdef.time * rsurface.texture->tcmod_parms[3];
+ for (texturesurfaceindex = 0;texturesurfaceindex < texturenumsurfaces;texturesurfaceindex++)
+ {
+ int j;
+ const float *v1, *in_tc;
+ float *out_tc;
+ const msurface_t *surface = texturesurfacelist[texturesurfaceindex];
+ for (j = 0, v1 = rsurface.modelvertex3f + 3 * surface->num_firstvertex, in_tc = rsurface.modeltexcoordtexture2f + 2 * surface->num_firstvertex, out_tc = rsurface.array_generatedtexcoordtexture2f + 2 * surface->num_firstvertex;j < surface->num_vertices;j++, v1 += 3, in_tc += 2, out_tc += 2)
+ {
+ out_tc[0] = in_tc[0] + amplitude * sin(((v1[0] + v1[2]) * 1.0 / 1024.0f + animpos) * M_PI * 2);
+ out_tc[1] = in_tc[1] + amplitude * sin(((v1[1] ) * 1.0 / 1024.0f + animpos) * M_PI * 2);
+ }
+ }
+ rsurface.texcoordtexture2f = rsurface.array_generatedtexcoordtexture2f;
+ rsurface.texcoordtexture2f_bufferobject = 0;
+ rsurface.texcoordtexture2f_bufferoffset = 0;
+ }
+ else
+ {
+ rsurface.texcoordtexture2f = rsurface.modeltexcoordtexture2f;
+ rsurface.texcoordtexture2f_bufferobject = rsurface.modeltexcoordtexture2f_bufferobject;
+ rsurface.texcoordtexture2f_bufferoffset = rsurface.modeltexcoordtexture2f_bufferoffset;
+ }
+ rsurface.texcoordlightmap2f = rsurface.modeltexcoordlightmap2f;
+ rsurface.texcoordlightmap2f_bufferobject = rsurface.modeltexcoordlightmap2f_bufferobject;
+ rsurface.texcoordlightmap2f_bufferoffset = rsurface.modeltexcoordlightmap2f_bufferoffset;
R_Mesh_VertexPointer(rsurface.vertex3f, rsurface.vertex3f_bufferobject, rsurface.vertex3f_bufferoffset);
}
RSurf_PrepareVerticesForBatch(true, r_glsl_permutation->loc_Texture_Normal >= 0, texturenumsurfaces, texturesurfacelist);
else
RSurf_PrepareVerticesForBatch(r_glsl_permutation->loc_Texture_Normal >= 0, r_glsl_permutation->loc_Texture_Normal >= 0, texturenumsurfaces, texturesurfacelist);
- R_Mesh_TexCoordPointer(0, 2, rsurface.modeltexcoordtexture2f, rsurface.modeltexcoordtexture2f_bufferobject, rsurface.modeltexcoordtexture2f_bufferoffset);
+ R_Mesh_TexCoordPointer(0, 2, rsurface.texcoordtexture2f, rsurface.texcoordtexture2f_bufferobject, rsurface.texcoordtexture2f_bufferoffset);
R_Mesh_TexCoordPointer(1, 3, rsurface.svector3f, rsurface.svector3f_bufferobject, rsurface.svector3f_bufferoffset);
R_Mesh_TexCoordPointer(2, 3, rsurface.tvector3f, rsurface.tvector3f_bufferobject, rsurface.tvector3f_bufferoffset);
R_Mesh_TexCoordPointer(3, 3, rsurface.normal3f, rsurface.normal3f_bufferobject, rsurface.normal3f_bufferoffset);
m.tex[1] = R_GetTexture(layer->texture);
m.texmatrix[1] = layer->texmatrix;
m.texrgbscale[1] = layertexrgbscale;
- m.pointer_texcoord[1] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[1] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[1] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[1] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[1] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[1] = rsurface.texcoordtexture2f_bufferoffset;
R_Mesh_TextureState(&m);
if (rsurface.lightmode == 2)
RSurf_DrawBatch_GL11_VertexShade(texturenumsurfaces, texturesurfacelist, layercolor[0], layercolor[1], layercolor[2], layercolor[3], applycolor, applyfog);
m.tex[0] = R_GetTexture(layer->texture);
m.texmatrix[0] = layer->texmatrix;
m.texrgbscale[0] = layertexrgbscale;
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
R_Mesh_TextureState(&m);
RSurf_DrawBatch_GL11_Unlit(texturenumsurfaces, texturesurfacelist, layercolor[0], layercolor[1], layercolor[2], layercolor[3], applycolor, applyfog);
break;
{
m.tex[0] = R_GetTexture(layer->texture);
m.texmatrix[0] = layer->texmatrix;
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
}
R_Mesh_TextureState(&m);
// generate a color array for the fog pass
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(layer->texture);
m.texmatrix[0] = layer->texmatrix;
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
R_Mesh_TextureState(&m);
RSurf_DrawBatch_GL11_Unlit(texturenumsurfaces, texturesurfacelist, layer->color[0] * 0.5f, layer->color[1] * 0.5f, layer->color[2] * 0.5f, layer->color[3], layer->color[0] != 2 || layer->color[1] != 2 || layer->color[2] != 2 || layer->color[3] != 1, false);
}
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(layer->texture);
m.texmatrix[0] = layer->texmatrix;
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
R_Mesh_TextureState(&m);
if (rsurface.lightmode == 2)
RSurf_DrawBatch_GL11_VertexShade(texturenumsurfaces, texturesurfacelist, layer->color[0], layer->color[1], layer->color[2], layer->color[3], layer->color[0] != 1 || layer->color[1] != 1 || layer->color[2] != 1 || layer->color[3] != 1, applyfog);
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(layer->texture);
m.texmatrix[0] = layer->texmatrix;
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
R_Mesh_TextureState(&m);
RSurf_DrawBatch_GL11_Unlit(texturenumsurfaces, texturesurfacelist, layer->color[0], layer->color[1], layer->color[2], layer->color[3], layer->color[0] != 1 || layer->color[1] != 1 || layer->color[2] != 1 || layer->color[3] != 1, applyfog);
break;
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(layer->texture);
m.texmatrix[0] = layer->texmatrix;
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
R_Mesh_TextureState(&m);
}
else
==============================================================================
*/
-#define Q3PATHLENGTH 64
//
else if (!strcasecmp(parameter[1], "vector")) layer->tcgen = Q3TCGEN_VECTOR;
else Con_DPrintf("%s parsing warning: unknown tcgen mode %s\n", search->filenames[fileindex], parameter[1]);
}
- else if (numparameters == 2 && !strcasecmp(parameter[0], "tcmod"))
+ else if (numparameters >= 2 && !strcasecmp(parameter[0], "tcmod"))
{
int i;
// observed values:
layer->tcmod_wavefunc = Mod_LoadQ3Shaders_EnumerateWaveFunc(parameter[2]);
}
else if (!strcasecmp(parameter[1], "transform")) layer->tcmod = Q3TCMOD_TRANSFORM;
- else if (!strcasecmp(parameter[1], "turb")) layer->tcmod = Q3TCMOD_TURB;
+ else if (!strcasecmp(parameter[1], "turb")) layer->tcmod = Q3TCMOD_TURBULENT;
else Con_DPrintf("%s parsing warning: unknown tcmod mode %s\n", search->filenames[fileindex], parameter[1]);
}
// break out a level if it was }
texture->basematerialflags |= MATERIALFLAG_FULLBRIGHT;
if (shader->primarylayer)
{
+ // copy over many shader->primarylayer parameters
+ texture->rgbgen = shader->primarylayer->rgbgen;
+ texture->alphagen = shader->primarylayer->alphagen;
+ texture->tcgen = shader->primarylayer->tcgen;
+ texture->tcmod = shader->primarylayer->tcmod;
+ memcpy(texture->rgbgen_parms , shader->primarylayer->rgbgen_parms , sizeof(texture->rgbgen_parms));
+ memcpy(texture->alphagen_parms, shader->primarylayer->alphagen_parms, sizeof(texture->alphagen_parms));
+ memcpy(texture->tcgen_parms , shader->primarylayer->tcgen_parms , sizeof(texture->tcgen_parms));
+ memcpy(texture->tcmod_parms , shader->primarylayer->tcmod_parms , sizeof(texture->tcmod_parms));
+ texture->tcmod_wavefunc = shader->primarylayer->tcmod_wavefunc;
+ // load the textures
texture->numskinframes = shader->primarylayer->numframes;
texture->skinframerate = shader->primarylayer->framerate;
for (j = 0;j < shader->primarylayer->numframes;j++)
}
shadowmesh_t;
+#define Q3PATHLENGTH 64
#define TEXTURE_MAXFRAMES 64
+#define Q3SHADER_MAXLAYERS 8
+#define Q3RGBGEN_MAXPARMS 3
+#define Q3ALPHAGEN_MAXPARMS 1
+#define Q3TCGEN_MAXPARMS 6
+#define Q3TCMOD_MAXPARMS 6
+
+typedef enum q3wavefunc_e
+{
+ Q3WAVEFUNC_NONE,
+ Q3WAVEFUNC_INVERSESAWTOOTH,
+ Q3WAVEFUNC_NOISE,
+ Q3WAVEFUNC_SAWTOOTH,
+ Q3WAVEFUNC_SIN,
+ Q3WAVEFUNC_SQUARE,
+ Q3WAVEFUNC_TRIANGLE,
+ Q3WAVEFUNC_COUNT
+}
+q3wavefunc_t;
+
+typedef enum q3rgbgen_e
+{
+ Q3RGBGEN_IDENTITY,
+ Q3RGBGEN_CONST,
+ Q3RGBGEN_ENTITY,
+ Q3RGBGEN_EXACTVERTEX,
+ Q3RGBGEN_IDENTITYLIGHTING,
+ Q3RGBGEN_LIGHTINGDIFFUSE,
+ Q3RGBGEN_ONEMINUSENTITY,
+ Q3RGBGEN_ONEMINUSVERTEX,
+ Q3RGBGEN_VERTEX,
+ Q3RGBGEN_WAVE,
+ Q3RGBGEN_COUNT
+}
+q3rgbgen_t;
+
+typedef enum q3alphagen_e
+{
+ Q3ALPHAGEN_IDENTITY,
+ Q3ALPHAGEN_CONST,
+ Q3ALPHAGEN_ENTITY,
+ Q3ALPHAGEN_LIGHTINGSPECULAR,
+ Q3ALPHAGEN_ONEMINUSENTITY,
+ Q3ALPHAGEN_ONEMINUSVERTEX,
+ Q3ALPHAGEN_PORTAL,
+ Q3ALPHAGEN_VERTEX,
+ Q3ALPHAGEN_WAVE,
+ Q3ALPHAGEN_COUNT
+}
+q3alphagen_t;
+
+typedef enum q3tcgen_e
+{
+ Q3TCGEN_NONE,
+ Q3TCGEN_TEXTURE, // very common
+ Q3TCGEN_ENVIRONMENT, // common
+ Q3TCGEN_LIGHTMAP,
+ Q3TCGEN_VECTOR,
+ Q3TCGEN_COUNT
+}
+q3tcgen_t;
+
+typedef enum q3tcmod_e
+{
+ Q3TCMOD_NONE,
+ Q3TCMOD_ENTITYTRANSLATE,
+ Q3TCMOD_ROTATE,
+ Q3TCMOD_SCALE,
+ Q3TCMOD_SCROLL,
+ Q3TCMOD_STRETCH,
+ Q3TCMOD_TRANSFORM,
+ Q3TCMOD_TURBULENT,
+ Q3TCMOD_COUNT
+}
+q3tcmod_t;
+
+typedef struct q3shaderinfo_layer_s
+{
+ int alphatest;
+ int clampmap;
+ float framerate;
+ int numframes;
+ char texturename[TEXTURE_MAXFRAMES][Q3PATHLENGTH];
+ int blendfunc[2];
+ q3rgbgen_t rgbgen;
+ q3alphagen_t alphagen;
+ q3tcgen_t tcgen;
+ q3tcmod_t tcmod;
+ float rgbgen_parms[Q3RGBGEN_MAXPARMS];
+ float alphagen_parms[Q3ALPHAGEN_MAXPARMS];
+ float tcgen_parms[Q3TCGEN_MAXPARMS];
+ float tcmod_parms[Q3TCMOD_MAXPARMS];
+ q3wavefunc_t tcmod_wavefunc;
+}
+q3shaderinfo_layer_t;
+
+typedef struct q3shaderinfo_s
+{
+ char name[Q3PATHLENGTH];
+ int surfaceparms;
+ int textureflags;
+ int numlayers;
+ qboolean lighting;
+ qboolean vertexalpha;
+ qboolean textureblendalpha;
+ q3shaderinfo_layer_t *primarylayer, *backgroundlayer;
+ q3shaderinfo_layer_t layers[Q3SHADER_MAXLAYERS];
+ char skyboxname[Q3PATHLENGTH];
+}
+q3shaderinfo_t;
typedef enum texturelayertype_e
{
// current texture transform matrix (used for water scrolling)
matrix4x4_t currenttexmatrix;
+ // various q3 shader features
+ q3rgbgen_t rgbgen;
+ q3alphagen_t alphagen;
+ q3tcgen_t tcgen;
+ q3tcmod_t tcmod;
+ float rgbgen_parms[Q3RGBGEN_MAXPARMS];
+ float alphagen_parms[Q3ALPHAGEN_MAXPARMS];
+ float tcgen_parms[Q3TCGEN_MAXPARMS];
+ float tcmod_parms[Q3TCMOD_MAXPARMS];
+ q3wavefunc_t tcmod_wavefunc;
+
qboolean colormapping;
rtexture_t *basetexture;
rtexture_t *glosstexture;
void Mod_ShadowMesh_CalcBBox(shadowmesh_t *firstmesh, vec3_t mins, vec3_t maxs, vec3_t center, float *radius);
void Mod_ShadowMesh_Free(shadowmesh_t *mesh);
-#define Q3SHADER_MAXLAYERS 8
-#define Q3RGBGEN_MAXPARMS 3
-#define Q3ALPHAGEN_MAXPARMS 1
-#define Q3TCGEN_MAXPARMS 6
-#define Q3TCMOD_MAXPARMS 6
-
-typedef enum q3wavefunc_e
-{
- Q3WAVEFUNC_NONE,
- Q3WAVEFUNC_INVERSESAWTOOTH,
- Q3WAVEFUNC_NOISE,
- Q3WAVEFUNC_SAWTOOTH,
- Q3WAVEFUNC_SIN,
- Q3WAVEFUNC_SQUARE,
- Q3WAVEFUNC_TRIANGLE,
- Q3WAVEFUNC_COUNT
-}
-q3wavefunc_t;
-
-typedef enum q3rgbgen_e
-{
- Q3RGBGEN_IDENTITY,
- Q3RGBGEN_CONST,
- Q3RGBGEN_ENTITY,
- Q3RGBGEN_EXACTVERTEX,
- Q3RGBGEN_IDENTITYLIGHTING,
- Q3RGBGEN_LIGHTINGDIFFUSE,
- Q3RGBGEN_ONEMINUSENTITY,
- Q3RGBGEN_ONEMINUSVERTEX,
- Q3RGBGEN_VERTEX,
- Q3RGBGEN_WAVE,
- Q3RGBGEN_COUNT
-}
-q3rgbgen_t;
-
-typedef enum q3alphagen_e
-{
- Q3ALPHAGEN_IDENTITY,
- Q3ALPHAGEN_CONST,
- Q3ALPHAGEN_ENTITY,
- Q3ALPHAGEN_LIGHTINGSPECULAR,
- Q3ALPHAGEN_ONEMINUSENTITY,
- Q3ALPHAGEN_ONEMINUSVERTEX,
- Q3ALPHAGEN_PORTAL,
- Q3ALPHAGEN_VERTEX,
- Q3ALPHAGEN_WAVE,
- Q3ALPHAGEN_COUNT
-}
-q3alphagen_t;
-
-typedef enum q3tcgen_e
-{
- Q3TCGEN_NONE,
- Q3TCGEN_TEXTURE, // very common
- Q3TCGEN_ENVIRONMENT, // common
- Q3TCGEN_LIGHTMAP,
- Q3TCGEN_VECTOR,
- Q3TCGEN_COUNT
-}
-q3tcgen_t;
-
-typedef enum q3tcmod_e
-{
- Q3TCMOD_NONE,
- Q3TCMOD_ENTITYTRANSLATE,
- Q3TCMOD_ROTATE,
- Q3TCMOD_SCALE,
- Q3TCMOD_SCROLL,
- Q3TCMOD_STRETCH,
- Q3TCMOD_TRANSFORM,
- Q3TCMOD_TURB,
- Q3TCMOD_COUNT
-}
-q3tcmod_t;
-
-typedef struct q3shaderinfo_layer_s
-{
- int alphatest;
- int clampmap;
- float framerate;
- int numframes;
- char texturename[TEXTURE_MAXFRAMES][Q3PATHLENGTH];
- int blendfunc[2];
- q3rgbgen_t rgbgen;
- q3alphagen_t alphagen;
- q3tcgen_t tcgen;
- q3tcmod_t tcmod;
- float rgbgen_parms[Q3RGBGEN_MAXPARMS];
- float alphagen_parms[Q3ALPHAGEN_MAXPARMS];
- float tcgen_parms[Q3TCGEN_MAXPARMS];
- float tcmod_parms[Q3TCMOD_MAXPARMS];
- q3wavefunc_t tcmod_wavefunc;
-}
-q3shaderinfo_layer_t;
-
-typedef struct q3shaderinfo_s
-{
- char name[Q3PATHLENGTH];
- int surfaceparms;
- int textureflags;
- int numlayers;
- qboolean lighting;
- qboolean vertexalpha;
- qboolean textureblendalpha;
- q3shaderinfo_layer_t *primarylayer, *backgroundlayer;
- q3shaderinfo_layer_t layers[Q3SHADER_MAXLAYERS];
- char skyboxname[Q3PATHLENGTH];
-}
-q3shaderinfo_t;
-
void Mod_LoadQ3Shaders(void);
q3shaderinfo_t *Mod_LookupQ3Shader(const char *name);
qboolean Mod_LoadTextureFromQ3Shader(texture_t *texture, const char *name, qboolean q1bsp, qboolean q3bsp, qboolean md3);
{
// ARB2 GLSL shader path (GFFX5200, Radeon 9500)
R_SetupSurfaceShader(lightcolorbase, false, ambientscale, diffusescale, specularscale);
- R_Mesh_TexCoordPointer(0, 2, rsurface.modeltexcoordtexture2f, rsurface.modeltexcoordtexture2f_bufferobject, rsurface.modeltexcoordtexture2f_bufferoffset);
+ R_Mesh_TexCoordPointer(0, 2, rsurface.texcoordtexture2f, rsurface.texcoordtexture2f_bufferobject, rsurface.texcoordtexture2f_bufferoffset);
R_Mesh_TexCoordPointer(1, 3, rsurface.svector3f, rsurface.svector3f_bufferobject, rsurface.svector3f_bufferoffset);
R_Mesh_TexCoordPointer(2, 3, rsurface.tvector3f, rsurface.tvector3f_bufferobject, rsurface.tvector3f_bufferoffset);
R_Mesh_TexCoordPointer(3, 3, rsurface.normal3f, rsurface.normal3f_bufferobject, rsurface.normal3f_bufferoffset);
m.pointer_texcoord_bufferoffset[0] = rsurface.vertex3f_bufferoffset;
m.texmatrix[0] = rsurface.entitytoattenuationxyz;
m.tex[1] = R_GetTexture(basetexture);
- m.pointer_texcoord[1] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[1] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[1] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[1] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[1] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[1] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[1] = rsurface.texture->currenttexmatrix;
m.texcubemap[2] = R_GetTexture(rsurface.rtlight->currentcubemap);
m.pointer_texcoord3f[2] = rsurface.vertex3f;
m.pointer_texcoord_bufferoffset[0] = rsurface.vertex3f_bufferoffset;
m.texmatrix[0] = rsurface.entitytoattenuationxyz;
m.tex[1] = R_GetTexture(basetexture);
- m.pointer_texcoord[1] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[1] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[1] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[1] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[1] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[1] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[1] = rsurface.texture->currenttexmatrix;
GL_BlendFunc(GL_ONE, GL_ONE);
}
m.pointer_texcoord_bufferoffset[1] = rsurface.vertex3f_bufferoffset;
m.texmatrix[1] = rsurface.entitytoattenuationz;
m.tex[2] = R_GetTexture(basetexture);
- m.pointer_texcoord[2] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[2] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[2] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[2] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[2] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[2] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[2] = rsurface.texture->currenttexmatrix;
if (rsurface.rtlight->currentcubemap != r_texture_whitecube)
{
m.pointer_texcoord_bufferoffset[1] = rsurface.vertex3f_bufferoffset;
m.texmatrix[1] = rsurface.entitytoattenuationz;
m.tex[2] = R_GetTexture(basetexture);
- m.pointer_texcoord[2] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[2] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[2] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[2] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[2] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[2] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[2] = rsurface.texture->currenttexmatrix;
GL_BlendFunc(GL_ONE, GL_ONE);
}
// second pass
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(basetexture);
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[0] = rsurface.texture->currenttexmatrix;
if (rsurface.rtlight->currentcubemap != r_texture_whitecube)
{
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(normalmaptexture);
m.texcombinergb[0] = GL_REPLACE;
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[0] = rsurface.texture->currenttexmatrix;
m.texcubemap[1] = R_GetTexture(r_texture_normalizationcube);
m.texcombinergb[1] = GL_DOT3_RGBA_ARB;
// second pass
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(basetexture);
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[0] = rsurface.texture->currenttexmatrix;
if (rsurface.rtlight->currentcubemap != r_texture_whitecube)
{
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(normalmaptexture);
m.texcombinergb[0] = GL_REPLACE;
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[0] = rsurface.texture->currenttexmatrix;
m.texcubemap[1] = R_GetTexture(r_texture_normalizationcube);
m.texcombinergb[1] = GL_DOT3_RGBA_ARB;
// second pass
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(basetexture);
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[0] = rsurface.texture->currenttexmatrix;
if (rsurface.rtlight->currentcubemap != r_texture_whitecube)
{
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(normalmaptexture);
m.texcombinergb[0] = GL_REPLACE;
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[0] = rsurface.texture->currenttexmatrix;
m.texcubemap[1] = R_GetTexture(r_texture_normalizationcube);
m.texcombinergb[1] = GL_DOT3_RGBA_ARB;
// second pass
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(basetexture);
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[0] = rsurface.texture->currenttexmatrix;
m.tex3d[1] = R_GetTexture(r_shadow_attenuation3dtexture);
m.pointer_texcoord3f[1] = rsurface.vertex3f;
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(normalmaptexture);
m.texcombinergb[0] = GL_REPLACE;
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[0] = rsurface.texture->currenttexmatrix;
m.texcubemap[1] = R_GetTexture(r_texture_normalizationcube);
m.texcombinergb[1] = GL_DOT3_RGBA_ARB;
// second pass
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(basetexture);
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[0] = rsurface.texture->currenttexmatrix;
if (rsurface.rtlight->currentcubemap != r_texture_whitecube)
{
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(normalmaptexture);
m.texcombinergb[0] = GL_REPLACE;
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[0] = rsurface.texture->currenttexmatrix;
m.texcubemap[1] = R_GetTexture(r_texture_normalizationcube);
m.texcombinergb[1] = GL_DOT3_RGBA_ARB;
// second pass
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(basetexture);
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[0] = rsurface.texture->currenttexmatrix;
if (rsurface.rtlight->currentcubemap != r_texture_whitecube)
{
// 2/0/0/1/2 3D combine blendsquare path
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(normalmaptexture);
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[0] = rsurface.texture->currenttexmatrix;
m.texcubemap[1] = R_GetTexture(r_texture_normalizationcube);
m.texcombinergb[1] = GL_DOT3_RGBA_ARB;
// fifth pass
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(glosstexture);
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[0] = rsurface.texture->currenttexmatrix;
if (rsurface.rtlight->currentcubemap != r_texture_whitecube)
{
// 2/0/0/2 3D combine blendsquare path
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(normalmaptexture);
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[0] = rsurface.texture->currenttexmatrix;
m.texcubemap[1] = R_GetTexture(r_texture_normalizationcube);
m.texcombinergb[1] = GL_DOT3_RGBA_ARB;
// fourth pass
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(glosstexture);
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[0] = rsurface.texture->currenttexmatrix;
m.tex3d[1] = R_GetTexture(r_shadow_attenuation3dtexture);
m.pointer_texcoord3f[1] = rsurface.vertex3f;
// 2/0/0/2/2 2D combine blendsquare path
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(normalmaptexture);
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[0] = rsurface.texture->currenttexmatrix;
m.texcubemap[1] = R_GetTexture(r_texture_normalizationcube);
m.texcombinergb[1] = GL_DOT3_RGBA_ARB;
// fifth pass
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(glosstexture);
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
m.texmatrix[0] = rsurface.texture->currenttexmatrix;
if (rsurface.rtlight->currentcubemap != r_texture_whitecube)
{
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(basetexture);
m.texmatrix[0] = rsurface.texture->currenttexmatrix;
- m.pointer_texcoord[0] = rsurface.modeltexcoordtexture2f;
- m.pointer_texcoord_bufferobject[0] = rsurface.modeltexcoordtexture2f_bufferobject;
- m.pointer_texcoord_bufferoffset[0] = rsurface.modeltexcoordtexture2f_bufferoffset;
+ m.pointer_texcoord[0] = rsurface.texcoordtexture2f;
+ m.pointer_texcoord_bufferobject[0] = rsurface.texcoordtexture2f_bufferobject;
+ m.pointer_texcoord_bufferoffset[0] = rsurface.texcoordtexture2f_bufferoffset;
if (r_textureunits.integer >= 2)
{
// voodoo2 or TNT
float *array_deformedsvector3f;
float *array_deformedtvector3f;
float *array_deformednormal3f;
+ float *array_generatedtexcoordtexture2f;
float *array_color4f;
float *array_texcoord3f;
float *lightmapcolor4f;
int lightmapcolor4f_bufferobject;
size_t lightmapcolor4f_bufferoffset;
+ float *texcoordtexture2f;
+ int texcoordtexture2f_bufferobject;
+ size_t texcoordtexture2f_bufferoffset;
+ float *texcoordlightmap2f;
+ int texcoordlightmap2f_bufferobject;
+ size_t texcoordlightmap2f_bufferoffset;
// transform matrices to render this entity and effects on this entity
matrix4x4_t matrix;
matrix4x4_t inversematrix;