Welcome to Fractal Forums

Fractal Software => Announcements & News => Topic started by: 3dickulus on June 28, 2017, 04:13:14 AM




Title: Fragmentarium 2.0 beta
Post by: 3dickulus on June 28, 2017, 04:13:14 AM
Moving Fragmentarium to 2.0 beta for the end of an era!

This is for testing double dvec2 dvec3 dvec4

I added to the Parser, GUIParameter and VariableWidget classes uniform type sensing for the above mentioned double types, these are set using GL calls in DisplayWidget class instead of the QtShaderProgram object in VariableEditor class.
Sliders have 7 decimal places for floats and 14 for double types. Also comming soon in 2.0... saving "Deep" EXR format images.
Here is the 2.0.beta source (https://github.com/3Dickulus/FragM) for anyone that wants to try it out ;)

Test shader code...
Examples/Experimental/DoubleTest.frag
Examples/Include/BufferShader-4.frag
Examples/Include/Progressive2D-4.frag

Your gfx card must support GL 4.0 or greater.

Running from console will output vars, types and values used.


Title: Re: Fragmentarium 2.0 beta
Post by: DarkBeam on June 28, 2017, 04:02:45 PM
oh shiny  :beer:


Title: Re: Fragmentarium 2.0 beta
Post by: 3dickulus on June 29, 2017, 03:47:28 AM
Yes, shiny, but still needs polishing  :-\  I also reworked the 'uniform setting algorithm' so they only get set once per frame instead of every subframe (except the subframe counter) this should be a tiny speedup but has raised a couple of bugs like image area doesn't always render after setting a preset, need to give the GL area focus by clicking it, and the sliders for the buffershader (Post tab) don't all get enabled with 14 decimal places even though they are reported as double types ??? strangely Exposure does show up with 14 but the others don't ??? I think it's because buffershader vars are defined as sliders in the main shader and then again as uniforms in the buffershader, this 'shadowing' trick works fine at the frag code level but the GUI seems to have some issues with rendering the widgets properly.

Input is always appreciated  :beer:


Title: Re: Fragmentarium 2.0 beta
Post by: claude on June 29, 2017, 12:56:47 PM
the ilmbase stuff is missing so the mklinux.sh doesn't work out of the box - I just deleted all the exr stuff from it and got it compiled.  only tested briefly, but seems shiny indeed.  cheers!

also tested on laptop, had to comment out glUniform4d etc (4 lines total) because they weren't defined when compiling.  laptop has no double support, but the non-double stuff seems to still work fine.


Title: Re: Fragmentarium 2.0 beta
Post by: 3dickulus on June 30, 2017, 03:02:37 AM
@claude yes, the OpenEXR stuff is not included, this is the Fragmentarium sources only, it is intended as a "drop in" replacement for the existing 1.0.31 sources and should look and smell just like 1.0.31 with the added bonus of double type support :D I did set the USE_OPEN_EXR flag to OFF as default in the CMakeLists.txt file.

I also altered the BufferShader-4.frag, it seems that it doesn't need gl_ProjectionMatrix in the vertex fragment???

old vertex code...
Code:
out vec2 coord;

void main(void)
{
gl_Position =  gl_Vertex;
coord = (gl_ProjectionMatrix*gl_Vertex).xy;
}
new vertex code....
Code:
out vec2 coord;

void main(void)
{
gl_Position =  gl_Vertex;
coord = gl_Vertex.xy;
}

This appears to work perfectly, I guess it's because the matrix was identity (1s) so no real transformation was going on when rendering from the buffer anyways.

EDIT: Progressive2D-4.frag doesn't need gl_ProjectionMatrix in the vertex fragment either???
old vertex code...
Code:
out vec2 coord;
out vec2 aaScale;
out vec2 viewCoord;
// Use this to adjust clipping planes
uniform dvec2 Center; slider[(-100,-100),(0,0),(100,100)] NotLockable
uniform double Zoom; slider[0,1,50000] NotLockable

uniform vec2 pixelSize;

void main(void)
{
double ar = pixelSize.y/pixelSize.x;
gl_Position =  gl_Vertex;
viewCoord = gl_Vertex.xy;
coord = (((gl_ProjectionMatrix*gl_Vertex).xy*vec2(ar,1.0))/vec2(Zoom)+  vec2(Center));
aaScale = vec2(gl_ProjectionMatrix[0][0],gl_ProjectionMatrix[1][1])*pixelSize/vec2(Zoom);
}
new vertex code....
Code:
out vec2 coord;
out vec2 aaScale;
out vec2 viewCoord;
// Use this to adjust clipping planes
uniform dvec2 Center; slider[(-100,-100),(0,0),(100,100)] NotLockable
uniform double Zoom; slider[0,1,50000] NotLockable

uniform vec2 pixelSize;

void main(void)
{
double ar = pixelSize.y/pixelSize.x;
gl_Position =  gl_Vertex;
viewCoord = gl_Vertex.xy;
coord = (gl_Vertex.xy*vec2(ar,1.0))/vec2(Zoom)+vec2(Center);
aaScale = pixelSize/vec2(Zoom);
}


Title: Re: Fragmentarium 2.0 beta
Post by: 3dickulus on July 24, 2017, 04:38:33 AM
Added EXR tools menu, shows some help about usage. (used exrenvmap to make this)
Added samplerCube uniform :D

NEGATIVE_X=0
POSITIVE_X=1
POSITIVE_Y=2
NEGATIVE_Y=3
NEGATIVE_Z=4
POSITIVE_Z=5

to use the samplerCube just...
Code:
#define providesBackground
#group Skybox
uniform samplerCube skybox; file[cubemap.png]
vec3  backgroundColor(vec3 dir) {
    return textureCube(skybox, dir).rgb;
}
...before #include Raytracer.frag

sources at https://github.com/3Dickulus/FragM

Ditch-River Panorama HDR example in Fragmentarium.
It is authored by 'Blotchi' and copyrighted by http://www.hdrlabs.com/sibl/archive.html
It is licensed under a CC3.0 license: http://creativecommons.org/licenses/by-nc-sa/3.0/us/



Title: Re: Fragmentarium 2.0 beta
Post by: 3dickulus on July 25, 2017, 02:34:11 AM
Skybox works great!!!

add some refraction....

before #include DE-Raytracer.frag...
Code:
#define  providesColor
after #include DE-Raytracer.frag...
Code:
uniform float RefractiveIndex; slider[0,1,10]
vec3 baseColor(vec3 point, vec3 N){
    float ratio = 1.00 / RefractiveIndex;
    vec3 I = normalize(point - from);
    vec3 R = refract(I, N, ratio);
    return textureCube(skybox, R).rgb;
}

some values for RefractiveIndex...
Air    1.00
Water    1.33
Ice    1.309
Glass    1.52
Diamond    2.42

...using Glass for this image


Title: Re: Fragmentarium 2.0 beta
Post by: 3dickulus on October 21, 2017, 05:15:25 PM
I think I've managed to stabilize that (apparently) random crash that would happen after writing more than 100 messages to the log window and a couple of other things like wrong first tile when under script control. :D

As FractalForums.com is winding down I thought a closing post with a link to the downloads section on the new site would be appropriate, this is also a big :thanks1:  to all the folks that make FF possible and to all of the users who have contributed ideas and code, and, most importantly, to the original creator of Fragmentarium, Mikael Hvidtfeldt Christensen a.k.a. Syntopia. 

You can find packages for Win, Mac and linux here https://fractalforums.org/index.php?action=downloads;sa=view;down=4
You can find the source code here https://github.com/3Dickulus/FragM

 :thanks2:

A little reminder that Fragmentarium is still developing and highly experimental.