Logo by chaos_crystal - 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. September 19, 2019, 07:47:44 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 2 3 [4] 5   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: Patryk Kizny Raytracer Updates  (Read 5842 times)
0 Members and 1 Guest are viewing this topic.
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #45 on: April 16, 2016, 08:58:27 PM »

Two notes on that.
I based my work on Kn2 raytracer and I think that there was already a problem with reflections there.
I am aware of the fact that when I added all my features it could have gotten worse. I did not debug for reflections.

As for glossiness of materials on reflections - I think the problem is not the very jitter function but rather how environment is sampled and how the ray is reflected. Of top off my mind.

I am happy you're playing with all this.
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #46 on: April 26, 2016, 10:08:19 PM »

materials+texturing+hmapping

Logged

Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #47 on: April 29, 2016, 07:59:56 PM »

Inspiring. What fractal is that?
What's actually textured here? Can you share frag & maps?
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #48 on: April 29, 2016, 09:19:20 PM »

Don't you recognize ?  grin That's standard mandelbulb )
I got last Knighty's DE with terrain and better AO, added more terrains from your terrain generator, added texturing for terrain and simple mapping as M Benesi code in his smooth menger experiments. And M Benesi palette, it looks much better than standard.
If you want the same render, here is texrure I used http://ftourini.deviantart.com/art/tileable-stone-wall-texture01-217328604
p.s. I working in original version of Frag, because i go out of range in sliders very often and very far  wink

I got different renders when used original 3D+buffershader and yours. I saw - you cut tonemapping code from buffershader to 3D.frag. Is that right?



* hmap_dither_2.bmp Files.rar (19.73 KB - downloaded 94 times.)
Logged

Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #49 on: April 29, 2016, 09:24:58 PM »

Don't you recognize ?  grin That's standard mandelbulb )
I got last Knighty's DE with terrain and better AO, added more terrains from your terrain generator, added texturing for terrain and simple mapping as M Benesi code in his smooth menger experiments. And M Benesi palette, it looks much better than standard.
If you want the same render, here is texrure I used http://ftourini.deviantart.com/art/tileable-stone-wall-texture01-217328604
p.s. I working in original version of Frag, because i go out of range in sliders very often and very far  wink

I got different renders when used original 3D+buffershader and yours. I saw - you cut tonemapping code from buffershader to 3D.frag. Is that right?




Yes, at some point I moved the post part from shader to 3d. There was some reason for it but actually I was just thinking yesterday if I can move it back wink
Anyways, you should be using a full package of files from me (changes were across the range of files).

In my latest version, there are reflection environments per material and much more cool stuff. Plan on adding glossiness adjustments for reflections also.
This raytracer is getting really refined! Next step is adding motion blur (but that will work only under synthclipse if I do it).
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #50 on: April 29, 2016, 09:53:34 PM »

I checked your changes with original De-Kn2. And if you do not mind I will use only your "materials feature" with my version of renderer ) Glossiness looks good for textured plane. So I wait any updates too
Logged

Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #51 on: May 10, 2016, 02:56:28 AM »

Guys, I need a bit of help. I am trying to implement proper glossiness parameter for reflections.
Essentially I am tackling into the reflections loop. After calculating color, the ray is reflected (bounced) off the last surface and we enter the next trace loop. At this stage I have a ray, hitpoint and of course normal.
 
Now the simplest glossiness could be implemented by adding a random bias vector to the bounced ray direction.
Bias 0 = fully glossy reflections. But this is not a proper way of doing it and produces ugly results.

A better solution seem to be sampling a random direction vector in the cone which axis the same as ray.direction vector.
Or, in other words, finding a uniformly distributed sample on a circle that is perpendicular to reflected ray.direction and using it as a bias vector.

And I am getting a bit stuck here - can you help me find a fast and reasonable way of implementing it? Something elegant?
I would like to avoid converting to spherical coordinates and back as it seems redundant.

Perhaps it's trivial, but can't find to seem a compact solution myslef nor google anything simple.
Thanks!
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
hobold
Fractal Bachius
*
Posts: 573


« Reply #52 on: May 10, 2016, 10:23:18 AM »

Or, in other words, finding a uniformly distributed sample on a circle that is perpendicular to reflected ray.direction and using it as a bias vector.
just some observations that might help clearing the obstacle:

1. the disk to be sampled lies on a plane perpendicular to the reflected direction => reflected direction vector is that plane's normal vector

2. a reasonable 2D coordinate system on that plane can be constructed like this: find normal vector's component of smallest magnitude and compute the cross product of the normal vector with the unit vector of the respective axis to get a local coordinate axis on the plane (this computation can be optimized due to all the zeros in the axis vector). Another cross product delivers the other local coordinate axis on the plane.

The problem is now reduced to 2D. See, for example, http://mathworld.wolfram.com/DiskPointPicking.html
Logged
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #53 on: May 11, 2016, 11:31:40 AM »

The problem is now reduced to 2D. See, for example, http://mathworld.wolfram.com/DiskPointPicking.html
interesting... I see that this math used in DoF calculating for bokeh:
Code:
vec2 uniformDisc(vec2 co) {
vec2 r = rand2(co);
return sqrt(r.y)*vec2(cos(r.x*TWO_PI),sin(r.x*TWO_PI));
}
If I want to paint only a circle around disk, how it will look mathematically? Like this:
 


* 001.jpg (93.6 KB, 396x297 - viewed 195 times.)
Logged

lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #54 on: May 11, 2016, 12:00:03 PM »

You could try using r = 1 - pow(u, exponent) instead of r = sqrt(u), higher exponent pushes points to the edge
Logged

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



WWW
« Reply #55 on: May 11, 2016, 12:43:05 PM »

Thank you very much for quick answer! But stupid question  undecided - what is "u" in your formula?
Logged

lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #56 on: May 11, 2016, 12:48:28 PM »

Corresponds to "r.y" in your code, a uniform random variable in [0,1).
Logged

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



WWW
« Reply #57 on: May 11, 2016, 01:12:46 PM »

It works!  smiley Have some excess poins... strange
I tried to find the way for adding more bokeh, more than calculates in existing raytracer

upd: This looks little better, but still excess poins
r = pow((1-pow(u,exponent)), 1/exponent)


* 002.jpg (35.53 KB, 411x303 - viewed 186 times.)
« Last Edit: May 11, 2016, 01:29:28 PM by Crist-JRoger » Logged

lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #58 on: May 11, 2016, 01:27:27 PM »

Are you using the sin-based "random number generator"? It's extremely non-uniform, maybe sometimes returns NaNs, who knows... smiley

/spoilt OpenCL programmer
Logged

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



WWW
« Reply #59 on: May 11, 2016, 01:33:15 PM »

Yes, all frags uses sin-based RNG by default. I'll check with Wang hash, later.. my working PC doesn't support 4 shaders
Thank you for help!  smiley
Logged

Pages: 1 2 3 [4] 5   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Updates to Pages and New Images added Images Showcase (Rate My Fractal) Nahee_Enterprises 14 5252 Last post May 08, 2009, 01:44:39 PM
by Nahee_Enterprises
Mandelbulb 3D for mac ! (with updates !) Mandelbulb 3d « 1 2 » slock 24 16223 Last post October 08, 2015, 11:31:00 PM
by jered
Implosion Group, fractalfield.com projects updates/collaboration invited Let's collaborate on something! danwinter 2 1147 Last post December 01, 2012, 12:40:22 AM
by stereoman
Implosion Group, fractalfield.com projects updates/collaboration invited Philosophy danwinter 2 1317 Last post January 08, 2013, 12:59:21 PM
by jehovajah
Fractal Raytracer Fractal Programs « 1 2 3 » Hedanito 31 4730 Last post December 18, 2013, 10:27:11 PM
by Hedanito

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.286 seconds with 28 queries. (Pretty URLs adds 0.017s, 2q)