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: Follow us on Twitter
 
*
Welcome, Guest. Please login or register. April 20, 2024, 03:41:15 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: Fragmentarium 0.9.1 Released  (Read 4740 times)
0 Members and 1 Guest are viewing this topic.
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« on: April 01, 2012, 12:28:52 PM »

I’ve released a new build of Fragmentarium, version 0.9.1 (“Chiaroscuro”).

It can be downloaded at Github (as of now only Windows builds are available):
http://syntopia.github.com/Fragmentarium/get.html

The usual caveats apply: Fragmentarium is very much work in progress, and is best suited for people who likes to experiment with code.

Dual buffers

The main new feature is support for dual buffers and dual shaders. The front buffer is swapped after each frame to the backbuffer, which can be accessed as: ‘uniform sampler2D backbuffer;’.

Buffers can be created as either 8-bit or 16-bit integer, or 32-bit float. The new buffers makes it possible to create accumulated ray tracing, high quality AA for 2D systems, and many types of feedback systems. The easiest way to start exploring these features is by looking at the new tutorials (see below).

Minor improvements:

* Changed UI a bit to make it easier to change from automatic to continuous rendering.
* Added context menu option to insert preset based on current settings.
* The syntax for using ’2D.frag’ is simpler now. Just implement: “vec3 color(vec2 c);”
* Bugfix: Fixed error in 2D.frag, where changing aspect ratio would mess up viewport translation.
* Bugfix: Fixed some errors in the included fragments: Noise, Tetrahedron, and several of Knighty’s examples were missing a ‘providesInit’.
* Bugfix: Fixed specular bug in standard-raytracer.
* Bugfix: Copying from web was sometimes weird (should now strip rich text).
* Bugfix: Autosave files now creates a directory with output files (necessary since the #BufferShader directive broke the old ‘include all in one file’ system).

New fragments:

* Added a new ‘tutorial’ category, with examples of many features in Fragmentarium.
* Soft-Raytracer.frag – An example progressive (accumulated) ray-tracer. DOF using finite aperture, HDR and tonemapping, soft shadows, and multiple ray ambient occlusion, and sub-pixel jittered high-quality anti-alias. All very experimental.
* Progressive2D.frag, Progressive2DJulia.frag – Can be used for high-quality (progressive) anti-alias of 2D systems. Uniform disk sampling, Gaussian and Box filtering, “gamma correct” averaging of samples.
* A Quilez inspired ‘Domain Distortion’ example.
* A dual-buffered Game of Life example.
* Mandelbrot Averaged Stripe Coloring example.
* Lifted Domain Coloring example (in 2D/3D).
* New ‘Theory’ category with examples of the dual number and automatic differentiation method.
* Some great new scripts from Knighty, for polyhedrons, knots, polychora, and hyperbolic tesselations.

ATI users

Some fragments fail on ATI cards. This seems to be due to faulty GLSL driver optimizations. A workaround is to lock the ‘iterations’ variable (click the padlock next to it). Adding a bailout check inside the main DE loop (e.g. ‘if (length(z)>1000.0) break;’) also seems to do the job. I don’t own an ATI card, so I cannot debug this without people helping.

Mac users

Some Mac users has reported problems with the last version of Fragmentarium. Again, I don’t own a Mac, so I cannot solve these issues without help.

Finally, please read the FAQ, before asking questions:
http://blog.hvidtfeldts.net/index.php/2011/12/fragmentarium-faq/
Logged
tit_toinou
Iterator
*
Posts: 192


« Reply #1 on: April 01, 2012, 04:14:24 PM »

Theses new features look promising.
I have a bug with the " #version ", I have to erase it from the code in order to compile in the Game of Life.
I often have the error  undecided  (on my ATI Card) :

"Could not create fragment shader: Fragment shader failed to compile with the following errors:
ERROR: 1:462: error(#160) Cannot convert from 'const float' to 'highp 3-component vector of float'
ERROR: error(#273) 1 compilation errors.  No code generated"

.
Is that the error you're talking about ?


I also got interested into the "Lifted Domain Coloring" paper !
Your images in 3D are good. You could also try to plot height=log(|z|) instead of height=|z|, a zero would be a precipice down to -Infinity.


Here is my Complex functions that might help (or not).
There is more trig function than usual and faster cos and sin.

Code:
#donotrun

float PI = 3.14159265358979323846264;

// COMPLEX
float cArg( vec2 z )
{
if( z.x != 0 )
{
return atan( z.y , z.x );
}
else
{
return PI*sign(z.y)/2.0;
}
}

float cAbs( vec2 z )
{
return  length( z );
}

float cAbsSquared( vec2 z )
{
return dot( z , z );
}

vec2 cCopy( vec2 z )
{
return vec2( z.x , z.y );
}

vec2 cPolar( float r , float t )
{
return vec2( r*cos(t) , r*sin(t) );
}

vec2 cCircle( float t )
{
return vec2( cos(t) , sin(t) );
}

vec2 cConj( vec2 z )
{
z.y = -z.y;
return z;
}

vec2 cUnit( vec2 z )
{
return z/cAbs(z);
}

// OPERATIONS

vec2 cAdd( vec2 z , float x )
{
z.x += x;
return z;
}

vec2 cAdd( vec2 z , float x , float y )
{
z.x += x;
z.y += y;
return z;
}

vec2 cMul( vec2 a , vec2 b )
{
float old_x = a.x;

a.x = old_x*b.x - a.y*b.y;
a.y = old_x*b.y + a.y*b.x;
 
return a;
}

vec2 cInverse( vec2 z )
{
z.y = -z.y;
return z/cAbsSquared( z );
}

vec2 cDiv( vec2 a , vec2 b )
{
return cMul( cInverse( b ) , a );
}

vec2 cSquared( vec2 z )
{
float old_x = z.x;

z.x = old_x*old_x - z.y*z.y;
z.y = 2*old_x*z.y;
 
return z;
}

vec2 cSqrt( vec2 z )
{
return cPolar( sqrt( cAbs( z ) ) , cArg( z )/2.0 );
}

vec2 cRotate( vec2 z , float t )
{
return cMul( z , cCircle( t ) );
}

vec2 cI( vec2 z )
{
float old_x = z.x;

z.x = -z.y;
z.y = old_x;

return z;
}

vec2 cPower( vec2 z , float x )
{
return cPolar( pow( cAbsSquared( z ) , x/2.0 ) , cArg( z )*x );
}

vec2 cExp( vec2 z )
{
return cPolar( exp( z.x ) , z.y );
}

vec2 cLog( vec2 z )
{
return vec2( log( cAbsSquared( z ) )/2.0 , cArg( z ) );
}

vec2 cPowerComplex( vec2 a , vec2 b )
{
float t = cArg( a );
float r2 = cAbsSquared( a );

return cPolar(
  pow( r2 , b.x/2.0 ) / exp( t * b.y )
, t*b.x + log( r2 )/2.0 * b.y
);
}

// TRIGONOMETRY
vec2 cCos( vec2 z )
{
float a = exp( z.y );
float b = 1.0/a;

a = a/2.0;
b = b/2.0;
   
return vec2(
   cos( z.x ) * ( a + b )
, -sin( z.x ) * ( a - b )
);
}

vec2 cSin( vec2 z )
{
float a = exp( z.y );
float b = 1.0/a;

a = a/2.0;
b = b/2.0;
   
return vec2(
  sin( z.x ) * ( a + b )
, cos( z.x ) * ( a - b )
);
}

vec2 cTan( vec2 z )
{
float a = tan( z.x );
float b = tanh( z.y );
return cDiv( vec2( a , b ) , vec2( 1 , -a*b ) );
}


#if __VERSION__ < 130
float cosh( float val )
{
float x = exp( val );
return ( x + 1.0/x ) / 2.0;
}

float sinh( float val )
{
float x = exp( val );
return ( x - 1.0/ x) / 2.0;
}

float tanh( float val )
{
//float x = exp(2.0*val);
//return (x - 1.0)/(x + 1.0);
return 1 - 2.0 / ( exp( 2*val ) + 1 );
}

float acosh( float x )
{
return log( x + sqrt( x*x - 1 ) );
}
 
float asinh( float x )
{
return log( x + sqrt( x*x + 1 ) );
}
#endif

vec2 cCosH( vec2 z )
{
return cCos( cI( z ) );
}

vec2 cSinH( vec2 z )
{
return -1.0 * cI( cSin( cI( z ) ) );
}

vec2 cTanH( vec2 z )
{
return -1.0 * cI( cTan( cI( z ) ) );
}

vec2 cArgCosH( vec2 z )
{
return cLog( z + cSqrt( cAdd( cSquared( cCopy( z ) ) , -1.0 )  ) );
}

vec2 cArgSinH( vec2 z )
{
return cLog( z + cSqrt( cAdd( cSquared( cCopy( z ) ) , 1.0 )  ) );
}

vec2 cArgTanH( vec2 z )
{
return cLog( cAdd( cInverse( cAdd( -1.0*z , 1.0 ) )*2.0 , -1.0 ) )/2.0;
}

vec2 cArgCos( vec2 z )
{
return -1.0 * cI( cArgCosH( z ) );
}

vec2 cArgSin( vec2 z )
{
return -1.0 * cI( cArgSinH( cI( z ) ) );
}

vec2 cArgTan( vec2 z )
{
return -1.0 * cI( cArgTanH( cI( z ) ) );
}

I don't really understand the thing with buffers.. Can we store data (arrays) now ?

"Added context menu option to insert preset based on current settings" Great !
Logged

Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #2 on: April 01, 2012, 04:51:13 PM »

Theses new features look promising.
I have a bug with the " #version ", I have to erase it from the code in order to compile in the Game of Life.

Oh. The texelFetch function should require #version 130. Does it work without the version statement?

Quote
I often have the error  undecided  (on my ATI Card) :

"Could not create fragment shader: Fragment shader failed to compile with the following errors:
ERROR: 1:462: error(#160) Cannot convert from 'const float' to 'highp 3-component vector of float'
ERROR: error(#273) 1 compilation errors.  No code generated"

No, the ATI I mention does not show up as an compilation error. Your error is probably because ATI is more strict. I think this is due to statements like:
Code:
vec3 a = 1.0;

which works fine on Nvidida, but needs to be
Code:
vec3 a = vec3(1.0);

on ATI.

For which example did you get the above message?

Quote
I also got interested into the "Lifted Domain Coloring" paper !
Your images in 3D are good. You could also try to plot height=log(|z|) instead of height=|z|, a zero would be a precipice down to -Infinity.
Thanks. For zeroes i plot "1/|z|" since this makes zeroes and poles of same order appear symmetric. Actually, the infinities does not work well with the heightmap approach, so you need to apply a sigmoid function - more about that here: http://blog.hvidtfeldts.net/index.php/2012/03/lifted-domain-coloring/

Quote
Here is my Complex functions that might help (or not).
There is more trig function than usual and faster cos and sin.

Thanks, will take a look!

Quote
I don't really understand the thing with buffers.. Can we store data (arrays) now ?

No. But now you can enable two off-screen buffers: a front and a back buffer of a specified type, e.g. 32 bit float (the pixel dimension will automatically match the viewport window, unless you use the Preview slider will will use lower resolution buffers). Fragmentarium now always write to the off-screen front buffer, which can read from the back buffer. After the pixel shader code has executed the buffers are swapped. The front buffer is rendered to screen using another shader (specified using the #BufferShader "..." command).

This is very useful since you can do stuff like accumulated rendering (progressively adding multiple samples per pixel) with higher precision color values (32-bit floats) and then do tone mapping and RGB conversion in the final buffershader. It makes higher quality anti-alias, true simulated depth-of-field, soft shadows, and "real" ambient occlusion (multiple directions) possible.

You can also do recursive feedback (Experimental/IFS.frag), and Game-of-Life using buffers.

It might sound complicated, but by substituting "DE-Raytracer" with "Soft-Raytracer.frag", or "2D.frag" with "Progressive2D.frag", most systems can directly use progressive rendering. Fragmentarium needs to be in 'Continuous' mode for the accumulation to run. Don't expect "Soft-Raytracer.frag" to be easier to use, though - the new options makes it more difficult to control, I'm afraid.
Logged
marius
Fractal Lover
**
Posts: 206


« Reply #3 on: April 01, 2012, 10:24:35 PM »


No, the ATI I mention does not show up as an compilation error. Your error is probably because ATI is more strict. I think this is due to statements like:
Code:
vec3 a = 1.0;

which works fine on Nvidida, but needs to be
Code:
vec3 a = vec3(1.0);

on ATI.

For which example did you get the above message?

For one, LiftedDomianColoring3D, offender is in Soft-Raytracer:

       if (color!=color) { color = 0.0; } // NAN check

Changing that to vec3(0.0) makes it happier.

AMD also complains loudy if #version isn't the very first statement. Love the Working w/ back buffer .frag!  grin
« Last Edit: April 01, 2012, 10:48:47 PM by marius » Logged
marius
Fractal Lover
**
Posts: 206


« Reply #4 on: April 01, 2012, 11:04:11 PM »

For one, LiftedDomianColoring3D, offender is in Soft-Raytracer:

       if (color!=color) { color = 0.0; } // NAN check

Changing that to vec3(0.0) makes it happier.

AMD also complains loudy if #version isn't the very first statement. Love the Working w/ back buffer .frag!  grin

progressive2D has similar need for vec3(0.0) in the NaN clause.
Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #5 on: April 02, 2012, 01:02:45 PM »

Thanks, Marius! I'll fix these.
Logged
tit_toinou
Iterator
*
Posts: 192


« Reply #6 on: April 28, 2012, 11:16:35 AM »

Since above 180 mgpxls Fragmentarium fails to merge all the tiles together (at least on my computer), you could add an option to save the tiles individually in the next version. Just an idea  grin .

PS: Here is what I've render in HiRes thanks to your amazing software  afro : http://gigapan.com/users/ttoinou/gigapans
My favorite is this one because it is well detailed at every level : http://gigapan.com/gigapans/98150.
Logged

Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #7 on: April 30, 2012, 10:22:57 PM »

Since above 180 mgpxls Fragmentarium fails to merge all the tiles together (at least on my computer), you could add an option to save the tiles individually in the next version. Just an idea  grin .

PS: Here is what I've render in HiRes thanks to your amazing software  afro : http://gigapan.com/users/ttoinou/gigapans
My favorite is this one because it is well detailed at every level : http://gigapan.com/gigapans/98150.

Nice images!

I think the 180MP is probably limited by the available memory. Saving individual frames should be possible.
Logged
Wug
Guest
« Reply #8 on: May 01, 2012, 12:56:51 AM »

Hi, I tried writing a script today in fragmentarium using recursive function calls but the compiler did not allow me to do so. Is there are an easy workaround to this, and is it really necessary for the compiler to block recursion?
Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #9 on: May 01, 2012, 08:44:14 AM »

Sorry - Fragmentarium doesn't use it own compiler. It does some preprocessing, but the code is still GLSL - which doesn't allow for recursion.
Logged
knighty
Fractal Iambus
***
Posts: 819


« Reply #10 on: May 01, 2012, 06:48:30 PM »

Two little suggestions:
- Some buffer clearing (glClearBuffer) are not necessary. They sometime cause some flickering and tearing.
- Is it possible to add filtering and wrapping options in the textures and backbuffer declarations?
Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #11 on: May 01, 2012, 10:39:00 PM »

Two little suggestions:
- Some buffer clearing (glClearBuffer) are not necessary. They sometime cause some flickering and tearing.

I have disabled one unneeded glClear(...). Perhaps this will help? Weirdly, I see no tearing or flickering at all on my machine - even though I explicitly disable double-buffering. I've created a new build - notice, that it is now possible to set the screen refresh rate in the preferences dialog.

Link: http://hvidtfeldts.net/Fragmentarium-Windows-Binary-v.9.1.10.zip

- Is it possible to add filtering and wrapping options in the textures and backbuffer declarations?

I don't think so. I've had a lot of problems with this when I did the 'Game of Life' sample (which needs to be pixel accurate and wrap properly).

If I understand it correctly you cannot set the filtering type on a GLSL sampler. Instead, 'texture2D' will always do bilinear filtering, and 'texelFetch' will do nearest point sampling. I think the same goes for wrapping - you have to do this yourself using 'mod' operator.

E.g. from the Game of Life:

Code:
// Simple version: does not work around borders
// vec4 v1 = texture2D( backbuffer, mod ( position + pixelSize*vec2( dx, dy ), 1.0 ) );

// Better version, using unfiltered samples:
vec2 p = mod(position + vec2(dx,dy)*pixelSize,1.0)/pixelSize;
vec4 v1 = texelFetch( backbuffer,  ivec2(p),0 );
   

I have tried setting the OpenGL texture flags (such as TEXTURE_WRAP_S,TEXTURE_WRAP_T,TEXTURE_MIN_FILTER,TEXTURE_MAG_FILTER) but they do not seem to affect GLSL samplers.

Logged
knighty
Fractal Iambus
***
Posts: 819


« Reply #12 on: May 02, 2012, 12:51:18 PM »

Thank you for the update.

I was thinking about doing something like:
Code:
uniform sampler2D texture; file["somefile.jpg"] : filter[GL_NEAREST] : wrap[GL_CLAMP] ...etc.
and apply the options in the main program.

I have tried setting the OpenGL texture flags (such as TEXTURE_WRAP_S,TEXTURE_WRAP_T,TEXTURE_MIN_FILTER,TEXTURE_MAG_FILTER) but they do not seem to affect GLSL samplers.
That's strange. Maybe the texture was not bound beforehand?
Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #13 on: May 02, 2012, 01:37:53 PM »

Thank you for the update.

I was thinking about doing something like:
Code:
uniform sampler2D texture; file["somefile.jpg"] : filter[GL_NEAREST] : wrap[GL_CLAMP] ...etc.
and apply the options in the main program.

Yes, I follow you and can easily see why this would be convenient. But I don't think it is possible.

I think the OpenGL options you set on textures apply to a fixed function pipeline (for instance, what arguments would you use, when setting the texture to GL_NEAREST? GL_TEXTURE_MIN_FILTER or GL_TEXTURE_MAG_FILTER? The transformation is not either a magnification or minification)

I think in GLSL the sampling mode is determined by the GLSL command (sampler=linear or texelFetch=nearest neighbor), and you have to code your wrappings.
If you want to avoid texelFetch, you might be able to use the standard sampler and carefully sample at the center of each texel.

Update: I just did a bit more browsing, and it seems that it should be possible to at least control the wrapping. If I find some time, I'll try again.

« Last Edit: May 02, 2012, 04:38:50 PM by Syntopia » Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #14 on: May 02, 2012, 08:35:52 PM »

I did some testing, and it is possible to specify the wrap mode. However, there are quite a few wrap modes (including border modes, which requires that a border is defined and choosen). Which wrap modes do you need? Just repeat and clamp? For x and y individually? Only for loaded textures or also for the backbuffer?

If you really need nearest neighbor sampling, use:
Code:
col = texture2D(texture, (floor(z*size)+vec2(0.5))/size ).xyz;
or
Code:
col = texelFetch(texture,ivec2(z*textureSize(texture,0)),0).xyz;

Update: turns out it is simple enough to set filtering:
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST) works for nearest neighbor sampling. (GL_TEXTURE_MIN_FILTER is ignored.)
All my confusion was simply because I used GL_POINT instead of GL_NEAREST in my tests...
                        
« Last Edit: May 02, 2012, 11:30:28 PM by Syntopia » Logged
Pages: [1] 2   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
a lil' problem with my DE formula in fragmentarium Programming ker2x 13 2633 Last post January 06, 2012, 09:55:55 AM
by ker2x
having fun with fragmentarium Images Showcase (Rate My Fractal) ker2x 5 2348 Last post January 14, 2012, 12:26:39 PM
by ker2x
Fragmentarium v0.9.12 released Fragmentarium Syntopia 6 2868 Last post November 06, 2012, 05:27:35 PM
by Syntopia
Help in Fragmentarium Fragmentarium Tim Emit 2 932 Last post January 15, 2013, 10:05:24 PM
by Tim Emit
Fragmentarium 1.0 Released Fragmentarium Syntopia 4 1782 Last post September 18, 2013, 12:10:27 PM
by DarkBeam

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