OpenArena Message Boards

OpenArena Contributions => Idea pit => Topic started by: revanic on September 23, 2014, 09:49:27 AM



Title: Fake bounce light
Post by: revanic on September 23, 2014, 09:49:27 AM
Something I've done before that looked nice.
Basically, take the light direction and invert it, scale z by half, and use the ambient light Color scaled by a new cvar like r_bounceScale.
Allows a second light to be on the model and helps keep things from being flat.


Title: Re: Fake bounce light
Post by: fromhell on September 23, 2014, 01:13:17 PM
This is almost the same idea as my "crazy lighting" experiment I removed from the engine that never worked, where I did the inverting on the lightgrid processing...but I couldn't get it to work.  though for that it was for sampling the lightgrid 3 more times for more light directions


I'd love more than one light direction represented on a model, looks way too uniform otherwise.  Rim lighting adds a lot.  UnrealEngine always had this advantage


also to do this bounce light in the Diffuselight function you'd really need to have it optimized.  It's very easy to make that function slow, probably could option this funciton like r_shadeSpecular in the engine now which picks a barely-even-different function for specular overbrighting


Title: Re: Fake bounce light
Post by: revanic on November 08, 2014, 10:00:03 AM
I've tested this out myself and it's not very slow. Probably the same speed as the normal lighting calc. Another thing is, when doing multiple lights, you can't use this skip the same way. This is my setup :
Code:
                 //if ( incoming <= 0 ) {
       //*(int *)&colors[i*4] = ambientLightInt; // can't use this here now
       //continue;
//}
if( incoming < 0) // needed because incoming can be -1 while bounce is 1 (opposite sides)
incoming = 0;
if( bounce < 0)
bounce = 0;

if( (incoming <= 0) && (bounce <= 0) ){
*(int *)&colors[i*4] = ambientLightInt; // now we can use this little skip!
continue;
}