Problem with brute (non DE) renderer

  • 4 Replies

0 Members and 1 Guest are viewing this topic.

Offline TGlad

  • *
  • Fractal Fruit Salad
  • *****
  • Posts: 62
    • Scale symmetry page
« on: November 19, 2018, 12:01:11 AM »
Hi all,

 I don't know if anyone is maintaining Fragmentarium these days, but if they are, I have a problem with the brute force renderer.

It uses screen-space ambient occlusion using the depth buffer. This causes stripes down the borders of the tiles when you make a high resolution rendering.

I can think of a few solutions:

1. the tiles could be made to overlap, so it removes the artefact
2. an option for no tiling? (or is this mandatory?)
3. a modification to the ambient occlusion which doesn't change shading at image edges

Is anyone able to help?

 many thanks


Offline Sabine62

  • *
  • Fractal Freak
  • **
  • Posts: 662
  • It's just a jump to the left...
« Reply #1 on: November 19, 2018, 12:27:58 AM »
TGlad, you could use either 1 tile (if your image is not too big for your GPU), or use 100% padding. The last one would increase your render time by 2 :(
On my nvidia 980Ti I can happily render 1920x1280 images with 1000 subframes if the render is not tooooooo heavy. Have no clue about your machine, of course.
100% padding is the safe option, but I would test even that on a smaller render...

And yes, Fragmentarium is very much maintained by 3Dickulus  :joy: We are currently at FragM 2.5 ;);sa=view;down=4
To thine own self be true

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1380
    • Digilantism
« Reply #2 on: November 19, 2018, 01:52:42 AM »
@TGlad I'm maintaining (hacking) the code but the frags are the responsibility of their respective authors. Tiling is mandatory in that 1 tile is the lowest number of tiles to make an image, however, presumably the brute tracer (with brute3D and depthBufferShader) will also have a border around a single tile, @Sabine62 is correct, add padding, but you only need enough to cover the flawed pixels which is about 3% @ 1920x1080 ?

edit: also the depthbuffershader is reading values from the alpha channel in frontbuffer

Code: [Select]
// xyz is color, w is depth.
vec4 tex = texture2D(frontbuffer, pos);

in the color() funtion in brute-raytracer it reads the 'depth' value from backbuffer alpha channel

Code: [Select]
float dist = texture2D( backbuffer,  position + pixelSize*vec2( dx, dy ) ).w;
the actual gl_FragDepth value (in the GL_DEPTH buffer) is calculated at the end of the color() function
by adding a bool DepthToAlpha widget to your frag you should be able to save  depth values in EXR format images as the alpha channel.

the reason for the gl_FragDepth stuff at the end of the color() function is because we render to a flat plane that is the size of the viewport and that makes GL put the depth value of the plane in the depth buffer, not the value from the fractal, this bit of code allows camera paths (rendered by GL post fractal) to be occluded by the fractal object.

hope that helps, feel free to ask me stuff about the internals of FragM C++ :)
« Last Edit: November 19, 2018, 02:30:21 AM by 3DickUlus »
Fragmentarium is not a toy, it is a very versatile tool that can be used to make toys ;)

Offline TGlad

  • *
  • Fractal Fruit Salad
  • *****
  • Posts: 62
    • Scale symmetry page
« Reply #3 on: November 19, 2018, 03:08:31 AM »
Ah! thanks both of you.

 I kind of glossed over the padding field because I didn't know what it did. So if that means it kind of adds some extra width to each tile so they effectively overlap, then that sounds perfect to solve the problem.
Otherwise I'll re-read your into about the buffers.

Thanks! and I'm glad it is being maintained, it is pretty much the best way to experiment with cool procedural structures.

By the way, if I wanted to contribute a structure or .frag file back into fragmentarium how would I do that? Presumably you vet them and the interesting ones get added into the examples?

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1380
    • Digilantism
« Reply #4 on: November 19, 2018, 03:35:38 AM »
I have a "tglad" folder in my Examples folder with Tetrahedral.frag in it,  can add that to the github repo and you can make contributions there, after some testing of course ;) I can also place files there for you :D

Re: Problem with brute (non DE) renderer

Started by Robert Badaracco on Fragmentarium

2 Replies
Last post October 23, 2019, 06:49:22 AM
by Robert Badaracco
The Beginnings of a Renderer

Started by blue_knight on Programming

5 Replies
Last post May 18, 2019, 03:19:37 PM
by mclarekin
I'm about to make a Mandelbrot set renderer

Started by galac on Programming

0 Replies
Last post May 05, 2019, 03:16:22 PM
by galac
A little problem?

Started by Know That Fractal! on Fractal Image Gallery

2 Replies
Last post December 25, 2017, 09:37:27 AM
by Fraktalist
is this a lighting problem?

Started by cubsterky on Mandelbulb3d

3 Replies
Last post March 09, 2018, 11:52:24 AM
by Bill Snowzell