Daemon icon indicating copy to clipboard operation
Daemon copied to clipboard

Mutualize SetLightDeluxeMode, SetLightMap, and SetDeluxeMap

Open illwieckz opened this issue 1 year ago • 3 comments

Another effort to mutualize code between the non-Material renderer and the Material one.

  • Mutualize SetLightDeluxeMode, SetLightMap, and SetDeluxeMap.
  • Rewrite SetRgbaGen as SetRgbGen and SetAlphaGen.

illwieckz avatar Aug 28 '24 16:08 illwieckz

Yeah, merging the code between material/non-material would be great. I've thought about merging the UpdateSurfaceData* functions with Render_* in tr_shade, though it would be a bit cumbersome with a bunch of type casts and if checks scattered around.

Why split rgbgen and alphagen though? Neither of those seems to be used individually.

VReaperV avatar Aug 28 '24 16:08 VReaperV

Why split rgbgen and alphagen though? Neither of those seems to be used individually.

It just made it easier to do something = Func(), less lines of code, and no confusion about things being used while not being set yet. This part is just bikeshedding.

I've thought about merging the UpdateSurfaceData* functions with Render_* in tr_shade

Yeah, I start with easier things, but in the end I want to make them share more code. Next step would be to make them share the Shader permutation selection and binding.

illwieckz avatar Aug 28 '24 17:08 illwieckz

I don't like the file name. I expect MaterialBlahBlah.h to be something only used for the material system

slipher avatar Aug 30 '24 02:08 slipher

I don't like the file name. I expect MaterialBlahBlah.h to be something only used for the material system

ShadeCommon, with shade like tr_shade.cpp?

(and not ShaderCommon which would be confusing with tr_shader.cpp which is about q3shaders)

illwieckz avatar Sep 05 '24 12:09 illwieckz

ShadeCommon, with shade like tr_shade.cpp?

All right

slipher avatar Sep 05 '24 16:09 slipher

ShadeCommon, with shade like tr_shade.cpp?

All right

Done.

illwieckz avatar Sep 06 '24 13:09 illwieckz