Logo by Tglad - 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: Check out the originating "3d Mandelbulb" thread here
 
*
Welcome, Guest. Please login or register. March 29, 2024, 07:30:43 AM


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 ... 4 5 [6] 7 8 ... 16   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: updating of DE-Raytracer  (Read 36382 times)
Description: adding features in DE-raytracer: volumetric light, kaliset3d, clouds...
0 Members and 1 Guest are viewing this topic.
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #75 on: October 13, 2015, 12:35:20 PM »

Question to Knighty, i found commented code of SSS-effect in shadow script. Don't really understand how it works and what means "DE defined inside"?
Logged

Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #76 on: November 07, 2015, 08:59:46 PM »

Need help with correction of little bug in IQ-clouds code. There is any restrictions or something interferes... just thinking out loud. Maybe somehow incorrectly identified 'CloudTops' and 'CloudBase'?


* cloud_bug.bmp Files.zip (17.12 KB - downloaded 62 times.)

* cloud_bug.jpg (40.21 KB, 800x450 - viewed 250 times.)
Logged

3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #77 on: November 18, 2015, 08:36:12 AM »

got it, I think...

at line 589 in DE-Kn2.frag
Code:
float rand(vec3 co){// implementation found at: lumina.sourceforge.net/Tutorials/Noise.html
return fract(sin(dot(co*0.123,vec3(12.9898,78.233,112.166))) * 43758.5453);
}

43758.5453 is too big and causes bit precision loss, delete the first place use only 3758.5453

edit: only tested on this image/view not sure if it will cause problems elsewhere


* cloud-bug-1.jpg (15.48 KB, 800x450 - viewed 265 times.)
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #78 on: November 19, 2015, 03:37:19 AM »

I note that all of the raytracers in Examples/include folder use this float rand(vec3 co) function, should this value 3758.5453 be used instead of 43758.5453 in all of them or is this relevant only to IQ-Clouds  huh?
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #79 on: November 19, 2015, 06:33:28 PM »

3dickulus, thank you very much!
I replaced vec3(12.9898,78.233,112.166) to vec3 uniform and played with values for better result  smiley

upd.: Now i understand how appears this horrible noisy parallel lines, especially on the floor, especially on the reflected floor after final rendering on high resolution  grin  grin  grin
This noise is most visible when Dithering=1. For eliminate the noise we must change values in fract(......) line 280 in DE-Kn2.frag - because there is a dependence on the scale approximation
Code:
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
I really thought that this values is something magical  embarrass


* de-bug.jpg (98.51 KB, 800x500 - viewed 261 times.)
« Last Edit: November 19, 2015, 10:28:48 PM by Crist-JRoger » Logged

3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #80 on: November 20, 2015, 02:58:08 AM »

many things use Dither*rand(), shadow, ambientOcclusion, and trace functions
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #81 on: November 22, 2015, 04:10:49 AM »

I found another thing that eliminated banding in the clouds...

remove *0.123 so this line in rand(vec3)...
Code:
return fract(sin(dot(co*0.123,vec3(12.9898,78.233,112.166))) * 43758.5453);
looks like...
Code:
return fract(sin(dot(co,vec3(12.9898,78.233,112.166))) * 43758.5453);
...using the original value of 43758.5453 , voila! no more marshmallow cubes

these 2 modifications still need to be tested, maybe one of them can clean-up banding in other places
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #82 on: November 22, 2015, 06:39:21 AM »

just did some testing...

changing 43758.5453 to 3758.5453 still has boxy artefacts, fewer but still there
removing *0.123 does not cheesy

so in DE-Kn2.frag @ line 603 (the vec3 rand function used by IQ-Clouds) remove *0.123 and keep 43758.5453

this seems to clean-up all of the boxy artefacts, can anyone else confirm?
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #83 on: November 22, 2015, 06:12:00 PM »

Yes it is! Thank you very much! Now clouds looks better


upd.: I replaced rand to wang for dithering. This looks awesome and fantastic!  joy

I don't know what is zoom here, but it done with MaxDistance=0.003 and 38 iterations of AmazinfSurface. I think 'Wang hash' must be applied as a new update of DE-Raytracer  wink
 

upd2.: Okay, i looked in code of DE-Kn2.frag many times, really don't know how it all works together, but when i commented some line and build to see what's happened - there is no changes, so i decide that this code is excess.
For example line 506
Code:
float stepFactor = clamp((fSteps)/float(GlowMax),0.0,1.0);
needed for glow, but glow is turned off, and no longer needed. Nevertheless, it is not clear exactly why stepFactor used in line 520
Code:
float ao = AO.w*stepFactor ;
I set float ao=0 and no changes on the screen... Why do we need this line?

I tried to find the way for more ambient occlusion gain in shadowed areas from spotlight. And vice versa  - decrease ambient occlusion in lighted areas. In other words, an increase in mutual influence of camlight and spotlight.
« Last Edit: November 22, 2015, 10:32:41 PM by Crist-JRoger » Logged

3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #84 on: November 23, 2015, 01:24:22 AM »

a little further down
Code:
if (DetailAO<0.0) ao = ambientOcclusion(hit, hitNormal);
the line you mention...
Code:
float ao = AO.w*stepFactor ;
makes sure that ao has a meaningful value if DetailAO == 0.0 and ao is not set by ambientOcclusion()
however,
DetailAO is almost never 0.0 (in my frags at least) so it might be ok to drop some of these lines and set a minimum of -0.0001 for DetailAO slider

really nice ocean scene btw  A Beer Cup

I will make an effort to update ratracer.frags with 'wang_hash' but it does require a minimum of GLv3.3
it might be an idea to add another includes folder for the stuff that is being updated to use extensions and newer GL calls, older cards will not like wang_hash sad so in a future release you may see Legacy includes folder and NewGL includes folder or something like that.
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #85 on: November 23, 2015, 08:08:15 AM »

Not sure that I understand you. ao is ambientOcclusion. No?
DetailAO is not = 0 you right, i always use value near -0.0001.
It hard to explain, sorry for my English. But i like ao effect, i think this is main thing in 3d renderer. And i like a lot of ao, because it makes the scene is volumetric and helps to separate objects on the tones of lighting.

About  extensions and newer GL calls - it really helps to accelerate rendering? Newer versions of GL contains newer functions for graphic optimization? Maybe any ideas? smiley
Logged

3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #86 on: November 23, 2015, 03:11:39 PM »

if DetailAO is always < 0.0 then we don't need the test...
Code:
if (DetailAO<0.0) ao = ambientOcclusion(hit, hitNormal);
it can be just...
Code:
ao = ambientOcclusion(hit, hitNormal);
or...
Code:
     ao = min( ambientOcclusion(hit, hitNormal), AO.w*stepFactor);
something like that, need to do some testing wink

About  extensions and newer GL calls - it really helps to accelerate rendering? Newer versions of GL contains newer functions for graphic optimization? Maybe any ideas? smiley

older code may not compile on newer cards and vice versa new code may not compile on older cards so we may need a transition state with 2 versions until older cards are phased out.  huh?
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #87 on: November 23, 2015, 03:39:41 PM »

3dickulus, thank you!

I found what i want  joy joy joy
Now i see that AO and hardshadows in not all shading elements. There is diffusion in lighting model.
So i tried to decrease AO from lighted area and i think it can be done here adding (1.0+ao) to SpotLight :
Code:
return (FG*SpotLight.xyz*SpotLight.w*falloff*(diffuse+ specular)*(1.0+ao)+CamLight.xyz*CamLight.w*(ambient)*(1.-ao))*color;

Now when we use AO and hard shadows both -  the value of AO more increases in shadowed areas.
Render does not claim to match the actual physical model, but with this code it looks more realistic.
Maybe somebody has more elegant solution. I would be very glad what you think.
Logged

Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #88 on: November 23, 2015, 06:24:47 PM »

I found another little bug in shadow calculating when FudgeFactor<1 and object has good view, but shadow is wrong
Need to return DE(p)*FudgeFactor in
Code:
float DEF2(vec3 p) {
if (EnableFloor) {
floorDist = abs(dot(floorNormal,p)-FloorHeight);
return min(floorDist, DE(p));
} else {
return DE(p);
}
}
Logged

3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #89 on: November 24, 2015, 02:53:43 AM »

 afro can you post a couple of small images of an area showing the result of your changes ?
I won't get to really try it until this weekend sad
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Pages: 1 ... 4 5 [6] 7 8 ... 16   Go Down
  Print  
 
Jump to:  


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