Pages: [1]
  Print  
Author Topic: Fake bounce light  (Read 5939 times)
revanic
VIP
Half-Nub


Cakes 4
Posts: 67


« 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.
Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #1 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
« Last Edit: September 23, 2014, 06:36:47 PM by fromhell » Logged

asking when OA3 will be done won't get OA3 done.
Progress of OA3 currently occurs behind closed doors alone

I do not provide technical support either.

new code development on github
revanic
VIP
Half-Nub


Cakes 4
Posts: 67


« Reply #2 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;
}
Logged
Pages: [1]
  Print  
 
Jump to: