Logo by Pauldelbrot - 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 19, 2024, 08:29:22 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] 2   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: Artifacts with DE rendering  (Read 3231 times)
0 Members and 2 Guests are viewing this topic.
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« on: December 20, 2015, 01:28:08 PM »

Hey,

I'm trying to nail down a raytracer rendering problem.
The problem is consistent across raytracers - I checked DE-Raytracer, DE-Kn2 and my versions.
I think some people already reported similar problems in other threads.
I have also deeply gone through the raytracer (de-kn2) to find any bugs, but wasn't able to fix the problem.

Have a look at a sample scene.
There's a simple plane with sin height applied.
When the amplitude is relatively low, it seems to render properly.
Wen you increase amplitude, it starts to break.

The artifacts respond mostly to tweaking fudge factor and dither.
To get a relatively clean render I need to go down really low with fudge factory, but it does not make clean image anyways.
Dither seems to affect how the artifacts look like.

I also added simple tweak in the test scene to produce some harder shapes (just rounding on the z input vector). These break the image even more.
I could suspect that normals are not calculated properly on edges, but not sure.

Do you have any ideas why all these things happen?
How can this be fixed?






* Scene.jpg (62.08 KB, 1370x1158 - viewed 279 times.)

* Scene2.jpg (74.81 KB, 1370x1158 - viewed 299 times.)

* Scene3.jpg (81.39 KB, 1370x1158 - viewed 320 times.)
* Scene_Files.rar (14.97 KB - downloaded 92 times.)
Logged

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



WWW
« Reply #1 on: December 20, 2015, 04:50:52 PM »

I think the DE for the sin-plane isn't taking the displacement magnitude into account, so it needs to be scaled down.

Also lol "fudge factory", that's where Tom Cruise works right? cheesy
Logged

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



kizny
WWW
« Reply #2 on: December 20, 2015, 05:25:00 PM »

I think the DE for the sin-plane isn't taking the displacement magnitude into account, so it needs to be scaled down.

It does not matter here in fact because I used lower values for amplitude.
You could take frequency into account to scale down amplitude, but it does not affect the rendering issue anyhow.
Once you approach amplitude to frequency ratio around 1.0 the render starts getting dirty.
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #3 on: December 20, 2015, 06:57:11 PM »

I think CJR offered up a fix re:fudge factory and didder
you will have to search the threads for it yourself though
Logged

Resistance is fertile...
You will be illuminated!

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



WWW
« Reply #4 on: December 20, 2015, 07:23:12 PM »

I think CJR offered up a fix re:fudge factory and didder
you will have to search the threads for it yourself though
No no no ) I just fixed shadows with the same effect. Used FudgeFactor.

So the same problem was when i tried to create gnarl3D from DarkBeam's formula. Very very low FudgeFactor. This formula contains sin (or cos - don't matter) functions too.
Logged

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



WWW
« Reply #5 on: December 20, 2015, 07:28:14 PM »

image 2 shows artefact in shadows so... it might help
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #6 on: December 20, 2015, 11:25:17 PM »

A DE must be the distance to the closest surface point on the object you are modelling (or a number less than this).

In your DE, you calculate the distance from a point to the surface directly below it (in the z-direction). This is not always the closest point (unless the surface is flat). When the magnitude increases, the probability that a nearby spike is closer also increases.

Calculating even the distance from a point to a sine curve is hard (no closed solution):
http://math.stackexchange.com/questions/514820/distance-between-point-and-sine-wave

However, in many cases you can use a coarse approximation together with a fudge factor (which will also work here, unless the variation is too fast).
Logged
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #7 on: December 21, 2015, 11:57:04 AM »

Mikael, many thanks for your reply. That sounds totally logical.
I started wondering what happens in other similar scenarios with height maps.
The Terrain (z.z - random noise) is prone to the same issues.
I ran a quick test with Mandelbulb and it looks like there are the same issues.

It would be interesting to find a more suitable way of flattening or bringing to earth surface some of these creatures.
Logged

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



WWW
« Reply #8 on: April 21, 2016, 01:03:45 PM »

However, in many cases you can use a coarse approximation together with a fudge factor (which will also work here, unless the variation is too fast).

Can you show any example how it works in Fragmentarium?
Logged

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



kizny
WWW
« Reply #9 on: April 21, 2016, 01:41:19 PM »

Can you show any example how it works in Fragmentarium?

I think that what Syntopia meant was using what we currently do as approximation.
So instead of having a proper DE we would have float DE(p) {return p.z + myfractalde}.
Which is essentially incorrect, but approximate and sufficient for smaller values.

Plus use dither and fudge to compensate.
A very low fudge factor is something like blending between DE rendering and bruteforce - i.e it increases the number of steps across the ray. Actually, I think that in some cases taking multiple constant small steps forward could be a better option both from the performance and clean results standpoint.

From my experience very low fudge factor (<0.3) dramatically increases computing time.
And there are examples with brute force method (julia quaternion) which run surprisingly fast (the power of GPU).

Perhaps a hybrid approach could be of use - i.e use DE for rough approximation say to travel 75-90% of the distance in 2-3 leaps and then switch to brute force method with a small step.

Would require serious rethinking and rewriting the raytracer (my modified version has grown very much and there's lots of calls to DE()}, but perhaps it's a good option.

Logged

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



WWW
« Reply #10 on: April 21, 2016, 02:12:48 PM »

I played with dithering... at random, haphazard  smiley Please correct me )

Code:
float hTextureIT(out vec3 q) {
float dt = FDither*(rand(q.xy*(float(subframe)))/1000);

vec2 horbittotal;
  vec4 hcolor=vec4(0.,0.,0.,0.);

q.x+=dt;
q.y+=dt;

hcolor = texture2D(tex, htextoff+(q.xy)*htexturespeed)*hintensity;

hcolor.w=length(hcolor.xyz);
q+=hscale*hcolor.w;

q = max(vec3(0.),q);
return q;
}

and added FudgeFactor for floor
Code:
float DEF(vec3 p) {
float d = DE(p) ;
if (EnableFloor) {
floorDist = DEfloor(p)*Ffudge;
return min(floorDist, d);
} else {
return d;
}
return d;
}

Result is not bad, but slow. And still has artifacts - parallel lines through pixel, i don't know where they from...  huh?

* hm_TEST.bmp Files.zip (25.01 KB - downloaded 73 times.)

* hm_TEST.jpg (18.03 KB, 450x400 - viewed 228 times.)

* hm_TEST2.jpg (20.1 KB, 450x400 - viewed 230 times.)
Logged

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



kizny
WWW
« Reply #11 on: April 21, 2016, 03:07:38 PM »

The aliasing issue you're having is inherent to mipmpas for textures.
Dig around, there was a thread a while ago here and 3dickulus nailed it and helped solve it.
Logged

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



WWW
« Reply #12 on: April 21, 2016, 03:30:25 PM »

here?
Not exactly understand what to do for clean aliasing  huh?
Logged

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



kizny
WWW
« Reply #13 on: April 21, 2016, 03:34:22 PM »

here?
Not exactly understand what to do for clean aliasing  huh?

The pixellated pattern you see is a result of mipmaps issue.
Logged

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



WWW
« Reply #14 on: April 21, 2016, 03:53:14 PM »

So, what to do? When i use #TexParameter myTexture GL_TEXTURE_MIN_FILTER GL_LINEAR - nothing changes

upd.: On radeon this parameter turns off heightmapping fully
« Last Edit: April 21, 2016, 05:43:09 PM by Crist-JRoger » Logged

Pages: [1] 2   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
strange artifacts in rendering M-set Programming saijanai 2 1678 Last post July 28, 2012, 02:45:00 PM
by saijanai
Mars Uncensored 002 Strange Artifacts Mandelbulber Gallery mclarekin 2 826 Last post March 31, 2013, 09:03:31 AM
by mclarekin
Why are these artifacts happening? Programming tryptophan 8 1669 Last post April 04, 2013, 05:39:05 PM
by eiffie
Fractal Compression Artifacts Movies Showcase (Rate My Movie) brasnacte 4 1888 Last post January 24, 2014, 11:08:48 PM
by Chillheimer
Grid artifacts with DE Kalles Fraktaler gerrit 4 2788 Last post October 02, 2017, 11:39:02 PM
by claude

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