Want to code a script that replicates radiosity illumination (light bounce) on props!
5 replies, posted
[IMG]https://upload.wikimedia.org/wikipedia/commons/5/55/Radiosity_Comparison.jpg[/IMG]
What I have is on the left. What I want is on the right, [URL="https://en.wikipedia.org/wiki/Radiosity_(computer_graphics)"]radiosity[/URL]. Or in other words, a light bounce effect (technically diffuse reflection) applied globally on all props. Current 'dynamic light' in source does not calculate light bounce and renders direct illumination alone.
[B]What I'm looking for here is an idea or approach for a script that can provide a replication (doesn't have to be accurate, close enough is good enough) of light bouncing from an illuminated prop to another prop. [/B]This can perhaps be done with standard lights spawned upon tracer hits from a lamp colored the same as a prop's material, or even mess with shaders or other settings. I myself am not an amazing coder and don't have much knowledge in what lua can provide me with, but I can learn.
Some guidance questions are for example: Can I calculate the RGB value of a prop's default, uncolored material using trace.HitPos? What functions/libraries would I need to be looking at? Is messing with shaders in lua an option, or is that only exclusive to C? Are there already working scripts/similiar scripts I should be looking into?
If anyone has any suggestions on how I can go about doing this - please post! Fank you and have a lovely day<3
did it btw 2 guy who rated funny k thx bye
This probably isn't going to help at all, but (as someone who's barely used anything in it), the[URL="http://wiki.garrysmod.com/page/Category:render"] render library [/URL]could be useful if you can figure out what all the functions in it do (which I can't seem to). I suppose [URL="http://wiki.garrysmod.com/page/render/ReadPixel"]render/ReadPixel[/URL] may be a start in trying to find the RGB of a prop (or any pixel of anything on the screen), but of course it'd be shaded...
Thanks Pan. It's definitely somewhere in the render library, looking into that atm
Anyone else got an idea?
You are not going to have an easy time.
Try using materials like with a shadow map, and modify the material of all brushes. You would have to bake it though, i don't think you would have enough power to do it in run time with Lua. Second guess would be using a module.
[QUOTE=dingusnin;49412092]You are not going to have an easy time.
Try using materials like with a shadow map, and modify the material of all brushes. You would have to bake it though, i don't think you would have enough power to do it in run time with Lua. Second guess would be using a module.[/QUOTE]
He doesn't have to do it in real time - it's an interesting idea. Trace through every pixel with some reflections of traces, get the light level, add a fraction of it to the pixel. For blurring, do a bunch of traces in each reflection.
[QUOTE=dingusnin;49412092]You are not going to have an easy time.
Try using materials like with a shadow map, and modify the material of all brushes. You would have to bake it though, i don't think you would have enough power to do it in run time with Lua. Second guess would be using a module.[/QUOTE]
This being nearly my only lead, mind going into slightly more specifics? Like, what's a shadow map or brushes?
[QUOTE=Disseminate;49412121]He doesn't have to do it in real time - it's an interesting idea. Trace through every pixel with some reflections of traces, get the light level, add a fraction of it to the pixel. For blurring, do a bunch of traces in each reflection.[/QUOTE]
What do you mean trace through every pixel with some reflections of traces?
Sorry, you need to Log In to post a reply to this thread.