Closed WHS-Phoenix closed 1 year ago
The rocket trail sprites (smokePuff shader) use rgbGen vertex
and are not broken. I didn't tested exactVertex right now but it probably works.
tess.color (unsigned short [4]) is set in RB_AddQuadStampExt(). tess.color becomes attr_Color in the GLSL shaders. vertColor
becomes a multiplier for the vertex color (attr_Color) in the GLSL shaders.
RB_AddQuadStamp() in the opengl2 renderer expects color to be float[4] in the range of 0.0 to 1.0. The opengl1 renderer expects color to be byte[4] in the range 0 to 255.
This code is used to convert sprite byte color from 0-255 to 0.0-1.0 range for opengl2's RB_AddQuadStamp().
float colors[4];
VectorScale4(ent->e.shaderRGBA, 1.0f / 255.0f, colors);
RB_AddQuadStamp( ent->e.origin, left, up, colors );
I adapted your conversion and it works flawlessly! My particles look better than ever. The last thing I would have expected was a simple normalization to be at fault. Thanks!
I recently ported my mod's engine changes into IOQuake3, and I'm having trouble with the OpenGL2 renderer. I've been using a particle system that relies on a single entity entrypoint into the renderer using an rgbGen exactvertex shader keyword, then colorizing the particles using internally computed values to assign to the vertex color array using RB_AddQuadStamp. For OpenGL1 I was able to pretty much just copy and paste the logic in from Quake 3 1.32b's source code. OpenGL2, however, changed the entire logic for ComputeShaderColors.
This:
Changed to this:
This causes the color values in my particle logic to go nowhere as prior they were read from tess.vertexColors and copied into tess.svars.colors. In OpenGL2's function no color values are set at all. This causes null values to be computed across my particles, making them flash red and black. I would attempt to revert the color logic, however something tells me this change was done for a reason and there might be a better way. In addition, the shaderCommands_t struct was changed and vertexColors is no longer an element. Any help would be appreciated.