Logo by Transdimensional - 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: Support us via Flattr FLATTR Link
 
*
Welcome, Guest. Please login or register. April 24, 2024, 07:12:03 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: Help with SunSky  (Read 310 times)
0 Members and 1 Guest are viewing this topic.
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« on: November 20, 2015, 10:39:46 PM »

Hey,

There's SunSky in frag examples that I am using with my renderer now.
The problem I encountered is that the bottom hemisphere is grey and I wanted to make it black or adjustable.
And I can't seem to be able to find what to modify to tweak it.

Any help?

 
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #1 on: November 21, 2015, 01:09:37 AM »

In 'vec3 sunsky(vec3 viewDir)' you can insert a line before the 'return' statement like:
 
Code:
sky = dot(up, viewDir)<0.0 ? 100.0*vec3(1,0,0) : sky;	

You still get a bit of grey near the horizon - here you can cheat a little and pull the sky down, by changing to:
Code:
float cosUpViewAngle = dot(up, viewDir);

If you want the to use the fake ground color to actually light your model, you'll have to update the 'sky' method as well.
Logged
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #2 on: November 21, 2015, 01:28:44 AM »

Thanks. That cuts a straight line which is not too cool.
I was rather curious what causes the effective grey in the lower hemisphere and how to create an organic falloff to black instead of grey.
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #3 on: November 21, 2015, 04:59:44 PM »

You ¨could mix in something smoothly based on the "dot(up, viewDir)" which is 1 for up, 0 for the horizon, and -1 for down.

I think all atmospheric models will turn white/grey near the horizon. The models are not welldefined below the horizon.
Logged
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #4 on: November 21, 2015, 05:56:18 PM »

Thanks. That's what I did.
What was better as a tweak in fact was to rotate the sky view dir along the Right axis. That way I achieve camera-dependent horizon shift which lowers the horizon to compensate for missing content due to limited raytracer range.

Thanks a lot for your help!
« Last Edit: November 21, 2015, 06:05:23 PM by Patryk Kizny » Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
need help with adding sunSky to Effies GI2 Fragmentarium SaMMy 1 296 Last post October 11, 2016, 10:18:52 PM
by Crist-JRoger
SunSky with 3DKn-1.0.1.frag for advanced DoF Fragmentarium Crist-JRoger 5 3762 Last post September 19, 2017, 07:46:51 PM
by Tim Emit

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.22 seconds with 25 queries. (Pretty URLs adds 0.008s, 2q)