Title: Mostly corrected dynamic light projection Post by: revanic on February 22, 2013, 01:42:46 PM Well, I was working on trying to fix up dynamic lighting for my own Id Tech 3 based game, and I managed to figure out this much. This code is not 100% perfect, and can bug up on some surfaces, usually curves. I can't really figure out how to completely perfect it, but its good enough for now, I guess.
Code: for ( i = 0 ; i < input->numVertexes ; i++, texCoords += 2, colors += 4) { ... skippin thru code... Code: // modulate the strength based on the distance and color as I said its not completely perfect, if you can find a way to perfect it, it would be a great help. Obviously you can use this :P ALSO it can be used in the environment map code to correct the projection there as well. OH, ALMOST FORGOT in tr_world.c, r_recursiveworldnode / Code: / determine which dlights are needed edit: and I forgot to mention that q3's dynamic lights are actualy 2x bigger than what they seem, this new code brings the edge of the dynamic light right to the edge of the radius which is why they seem so much bigger with this code. Title: Re: Mostly corrected dynamic light projection Post by: GrosBedo on February 24, 2013, 12:09:56 PM One cake for this great work!
Title: Re: Mostly corrected dynamic light projection Post by: revanic on February 24, 2013, 08:13:49 PM You're welcome :). Also I forgot to mention that if you use similar code for the environment maps, be sure to make it specifically affect only world brush models, 3d models with env maps will look VERY weird with this current code.
|