Logo by mjk1093 - 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. March 28, 2024, 12:54:19 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 ... 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 12771 times)
0 Members and 1 Guest are viewing this topic.
lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #60 on: May 11, 2016, 01:53:56 PM »

Friends don't let friends use that sin-thing smiley It is 100% certainly causing tons of errors everywhere it's used.

The Wang hash, while infinitely better than the sin-thing in all ways, still is not a good uniform random number generator (it's not even a random number generator, just a uniform-ish hash function)... if you're doing Monte Carlo, you want something accurate and high quality, else additional samples are more damaging the image than improving it (by injecting more and more influence of the b0rked function).
Logged

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



kizny
WWW
« Reply #61 on: May 11, 2016, 02:17:30 PM »

What can you suggest then?
I posted a bunch of noise functions here: http://www.fractalforums.com/index.php?topic=22522.0
But these are usually pretty expensive.
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #62 on: May 11, 2016, 02:56:42 PM »

Erm, those are something totally different though: those are noise functions, continuous functions like Perlin noise.

What's needed here is a (uniform) random number generator, or RNG. RNG (or tables) is needed for things like Perlin noise, not vice versa.
Logged

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



kizny
WWW
« Reply #63 on: May 11, 2016, 02:58:10 PM »

Oh, right. Forgot about that.
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #64 on: May 11, 2016, 03:11:16 PM »

I've probably said it too often by now, but i still think it's somewhat a shame that we have kinda shared goals but work separately.

I'm in Wroclaw from friday to tuesday, in case you want to maybe meet up; might end up living there a few months even.
Logged

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



kizny
WWW
« Reply #65 on: May 11, 2016, 04:51:45 PM »

I've probably said it too often by now, but i still think it's somewhat a shame that we have kinda shared goals but work separately.

I'm in Wroclaw from friday to tuesday, in case you want to maybe meet up; might end up living there a few months even.

We have a great party here on Friday evening - come over.
https://www.facebook.com/events/555370944644986/
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
phtolo
Navigator
*****
Posts: 79



« Reply #66 on: May 11, 2016, 10:01:39 PM »

Here's an example rng I have used in Framentarium.

Code:
int rand(in out ivec2 prnp)
{
int r0 = prnp.y >> 15;
int r1 = prnp.x ^ r0;
r0 = r1 << 17;
prnp.y = r0 ^ r1;
prnp.x = 69069 * prnp.x;
r1 = prnp.x ^ prnp.y;
return r1;
}

Inside your main function, create a seeded variable to keep the current state:
Code:
ivec2 prnp = ivec2(1257353,135);

Then call rand with the current state-variable to get a random value:
Code:
int irnd = rand(prnp);
float frnd = float(rand(prnp) & 0xfffffff)/268435455.0;
Logged
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #67 on: May 12, 2016, 10:16:35 AM »

Here's an example rng I have used in Framentarium.
  I copied your code into calculating disk for Dof. And nothing ) image is clear, Dof don't works absolutely. Anyway wanghash works!

The Wang hash, while infinitely better than the sin-thing in all ways, still is not a good uniform random number generator (it's not even a random number generator, just a uniform-ish hash function)... if you're doing Monte Carlo, you want something accurate and high quality, else additional samples are more damaging the image than improving it (by injecting more and more influence of the b0rked function).
What is better?  embarrass
Found this post on 1 google page )
With wang hash "holey" bokeh works well. Thank you!


* wh_newDof.jpg (51.52 KB, 499x324 - viewed 380 times.)
Logged

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



kizny
WWW
« Reply #68 on: May 14, 2016, 08:43:10 PM »

Need help. I guess it's a basic thing, but can't get my head around that.

- I have implemented a multi material thing in the raytracer.
- say therea are fractal objects with different materials, and two DEs;
Code:
m1, m2, de1, de2
- there's a function to blend between these materials:
Code:
blendMat(m1, m2, ratio)
working more less like mix(f1, fr, r) but on structs.

final DE is computed using IQ's sminpol function:

Code:
// polynomial smooth_ min (k = 0.1); --> fastest
float sminpol(float a, float b, float k) {
    float h = clamp(0.5 + 0.5 * (b - a) / k, 0.0, 1.0);
    return mix(b, a, h) - k * h * (1.0 - h);
}

as follows:

Code:
DE = sminpol(de1, de2, k);

Now as far as I understand based on documentation: http://www.iquilezles.org/www/articles/smin/smin.htm
sminpol returns values that are equal to min(de1, de2) or smaller.

Now what I need is to find a ratio that would blend materials. I don't need anything fancy, linear interpolation is fine.
It should give me:
0 if distance from DE to de1 == 0
1 if distance from DE to de2 == 0
[0 ... 1] for the smoothed corners.

How?
« Last Edit: May 14, 2016, 09:14:37 PM by Patryk Kizny » Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
eiffie
Guest
« Reply #69 on: May 14, 2016, 09:26:01 PM »

Have you tried just using the value "h" from IQ's formula to mix the materials?
Logged
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #70 on: May 14, 2016, 09:40:09 PM »

Here are two options:

[01] Blending with k as you suggested:
[02] Blend with the following formula:

Code:
float br = (min(de1, de2) / max(de1, de2)); // this gives 1 at the joints and 0 at non-smoothed areas
float m = de1<de2 ? 1 : 0; // comparing DE to check which one was closer if it was not blended
matBlendRatio = mix(m, 0.5, br); // blend between original object color and perfectly blended color (1/2 ratio) on joints

This looks more less good but I believe it is not an elegant solution. Someone with a better math skills could probably come with a simpler and way more elegant mapping function.

// edit
Actually, when I used separate K for color blending and a separate one for geometry this gives me good control. Solved, thanks!


* 01.jpg (28.2 KB, 1041x1080 - viewed 353 times.)

* 02.jpg (28.21 KB, 1041x1080 - viewed 545 times.)
Logged

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



WWW
« Reply #71 on: May 18, 2016, 08:29:33 AM »

Stupid quesion, but as user I dare to ask..
Is there other way to render 3D objects, faster and easy than DE(I am confused in terms of, in this case I am referring to the use of a raysteps) and the same time having similar characteristics? Just spend some time at shadertoy site, some shaders works well even on slow Intel GPU. Than with Eiffie's help i moved one shader to DE-render and it has become slow...
Logged

eiffie
Guest
« Reply #72 on: May 18, 2016, 01:57:06 PM »

If you use 3D.frag to set up the camera it does multi-sampling. The shaders on ShaderToy typically do not use multi-sampling so they are faster.
To answer your question (is there a faster method than DE) yes just turn the DE into a mesh and draw it as millions of polygons. Look at other threads for information on how to do that.
Logged
Pages: 1 ... 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 7800 Last post May 08, 2009, 01:44:39 PM
by Nahee_Enterprises
3D flame raytracer Images Showcase (Rate My Fractal) doncasteel8587 2 2910 Last post January 21, 2007, 12:38:51 PM
by doncasteel8587
Mandelbulb 3D for mac ! (with updates !) Mandelbulb 3d « 1 2 » slock 24 33261 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 2723 Last post December 01, 2012, 12:40:22 AM
by stereoman
Implosion Group, fractalfield.com projects updates/collaboration invited Philosophy danwinter 2 3114 Last post January 08, 2013, 12:59:21 PM
by jehovajah

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