NUKE leftover CPU lightGrid code, minor fixes and cleanup#1496
NUKE leftover CPU lightGrid code, minor fixes and cleanup#1496VReaperV merged 4 commits intoDaemonEngine:masterfrom
Conversation
28a73d5 to
49d98ef
Compare
|
Speaking of alternate lightgrid code, @VReaperV do you think it's technically doable to have a “lowest” lightgrid implementation (only meaningful for models), that would just sample the lightgrid color at the origin of the model (CPU side), and uniformly lit the whole model with that color (probably using the rgbgen fields), skipping entirely the lightgrid GLSL, relying on the fullbright GLSL code? |
Yeah, that would be easily doable. In fact, particles and trails already do pretty much that (but they interpolate between a few points) - which is kinda stupid, because it actually involves an IPC round-trip for no reason... |
| { | ||
| sscanf( value, "%f %f %f", &tr.worldEntity.ambientLight[ 0 ], &tr.worldEntity.ambientLight[ 1 ], | ||
| &tr.worldEntity.ambientLight[ 2 ] ); | ||
| if ( r_forceAmbient.Get() == 0 ) { |
There was a problem hiding this comment.
If r_forceAmbient is overriding some value specified by the BSP, shouldn't the cvar be off by default?
There was a problem hiding this comment.
Perhaps. I just used the value that was already there for it.
There was a problem hiding this comment.
There's also the issue that there could be maps relying on it.
Just as an ugly and cheap alternative for the “lowest” preset that would not be a cheat, because the model would still be dark in a dark room and lit in a lit room. It would save on GLSL processing and on GPU memory, and not involve 3D textures in GPU memory. Just a cheap alternative that would not be a cheat. |
We do this in GLSL now, and the results of this code are not actually used for anything.
These will now actually modify the lightGrid.
49d98ef to
c6d6122
Compare
|
(rebased) |
|
I'm merging it as is, if there are further concerns for the default value of |
You might be able to just use Daemon/src/engine/renderer/tr_light.cpp Line 188 in 5a071e2 Interpolating probably shouldn't be too much of an issue? If it is, just simply getting the closest point can be done easily enough. |
r_forceAmbient(hopefully) work by actually using it with the GLSL lightGrid.r_forceAmbientandr_ambientScalechanged to new-style cvars, +some cleanup.