Logo by AGUS - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit us on facebook
 
*
Welcome, Guest. Please login or register. April 20, 2024, 12:15:32 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: fake emissive material  (Read 1863 times)
Description: infinite lights with one calculation
0 Members and 1 Guest are viewing this topic.
eiffie
Guest
« on: March 20, 2012, 06:26:43 PM »

I wanted a way to place lit objects in a scene rendered with GLSL but didn't want to do global illumination or slow down the scripts too much. I decided to try a hack and simply calculate the closest point of light and base the lighting calculations on that. You simply add another DE (distance estimation) function for the light. Call it "DEL". You can use this function to calculate the nearest light direction similar to calculating the surface normal, only use the distance to the light as the delta like this:

vec2 vt=vec2(DEL(ray),0.0);
lightDir=normalize(vec3(-DEL(ray-vt.xyy)+DEL(ray+vt.xyy),
   -DEL(ray-vt.yxy)+DEL(ray+vt.yxy),
   -DEL(ray-vt.yyx)+DEL(ray+vt.yyx)));

You then continue with lighting calculations as you normally would. You can also use this distance to determine light fall-off and bloom. The cons are unrealistic lighting in some circumstances particularly with long shadows but the pros are infinite fractal lighting with one set of lighting calculations smiley

The video shows the worst case scenario (moving lights on both sides of objects casting shadows) and then how I want to use it by placing lights in fractal patterns.

<a href="http://www.youtube.com/v/MHRyWjRp3rY&rel=1&fs=1&hd=1" target="_blank">http://www.youtube.com/v/MHRyWjRp3rY&rel=1&fs=1&hd=1</a>

Since I don't see many examples of emissive light I would appreciate any input of ideas!
Logged
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #1 on: March 20, 2012, 08:49:38 PM »

would love to create a demo for a real-demo competition like breakpoint, as an collective effort of the forums ....
hybrid realtime fractals, emissive materials ... REALTIME!° that would be nice, you could also gather and create a nice ff wild entry wink
dunno exactly where next demo party will be ...
Logged

---

divide and conquer - iterate and rule - chaos is No random!
marius
Fractal Lover
**
Posts: 206


« Reply #2 on: March 21, 2012, 05:10:18 AM »

The video shows the worst case scenario (moving lights on both sides of objects casting shadows) and then how I want to use it by placing lights in fractal patterns.

You'd have to define a DE per light or group of lights, no? Otherwise it's hard to see how you'd get multiple highlights or shadows.

How do you do the shadow using a single DE call? Or is that result of a full march towards the nearest light as usual?
Logged
hobold
Fractal Bachius
*
Posts: 573


« Reply #3 on: March 21, 2012, 01:24:55 PM »

For a quick and dirty hack, this works much better than I would have expected. The first half of the test video is indeed a worst case (and even that works somewhat), but the second half looks convincing.
Logged
eiffie
Guest
« Reply #4 on: March 21, 2012, 04:27:21 PM »

That would be a fun project!

The shadows are indeed ray-marched. By "single lighting calculation" I meant as if there was ONE light. If you had to ray-march to each of the lights even on a GPU it would takes days to render. That was the point of the hack and I was happy with the results and how easy it was to implement.

It would be nice if there was an easy way to do lighting as we do ambient occlusion. Head off in a few directions and average the results but direction is critical in lighting.
Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Fake Plastic Trees Images Showcase (Rate My Fractal) Kali 1 2272 Last post March 07, 2012, 10:15:24 AM
by zonepatcher
Fake Minibrot Mandelbulb3D Gallery Sockratease 4 720 Last post April 21, 2012, 09:54:03 PM
by Sockratease
Material colors feature request DarkBeam 2 1199 Last post July 21, 2012, 10:56:21 PM
by DarkBeam
Fake Lake Mandelbulb3D Gallery trumanbrown 2 685 Last post October 17, 2012, 03:59:30 PM
by cKleinhuis
How to use this software in material science? UltraFractal kna007 6 1442 Last post October 18, 2012, 04:28:11 PM
by kna007

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.299 seconds with 27 queries. (Pretty URLs adds 0.021s, 2q)