Logo by Trifox - 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: Check out the originating "3d Mandelbulb" thread here
 
*
Welcome, Guest. Please login or register. January 18, 2019, 11:50:33 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: A few questions  (Read 970 times)
0 Members and 1 Guest are viewing this topic.
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« on: October 16, 2015, 12:58:17 AM »

Hey,

Moving to Synthclipse from Frag seduced by the graph editor and some other tweaks.
My frags are a bit complex, but compile properly under fragmentarium. There's a lot of 'implicit cast' warnings.

Now trying to compile same stuff implored to Synthclipse falls on each of such implicit casts.
Is there any way to tell the compiler to pass these kinds of issues?

I'm a bit tight in time and redoing these frags to he'd rid of implicit conversions would take ages.

Thanks!
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
SCORPION
Conqueror
*******
Posts: 104


« Reply #1 on: October 16, 2015, 03:10:08 AM »

This record is a warning (error)

Code:
float absScalemm = max(1.,abs((1.-Scale)/(1+Scale)))*2.;

So true and does not cause a warning (but longer)

Code:
float absScalemm = max(vec3(1.),abs((vec3(1.)-Scale)/(vec3(1)+Scale)))*2.;

Try it!
Logged
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #2 on: October 16, 2015, 03:45:23 AM »

@Patryk I posted a fixed version here http://www.fractalforums.com/index.php?topic=22130.msg87411#msg87411 that compiles with no warnings in Fragmentarium
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #3 on: October 16, 2015, 01:28:46 PM »

@Dick - many thanks for the fixes. That actually compiles pretty neatly.
Out of curiosity - the question is still valid. Is there any way to configure compiler to have control over what it accepts and what it rejects?

Another question.
I've gone through manuals but couldn't find it.

In the workflows I've developed I'm importing external camera transformation matrices to set the camera in the shader to match external footage for compositing.
Essentially it's a 3x3 camera transformation position with up/right/forward vectors plus a FOV.

In Fragmentarium I applied it each frame via QScript - so in my QScript editor I had my say 1000 frames-long array of transformations and for each of frames I'd set a set a uniforms based on that data.

What would be a way to do it in Synthclipse?





Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
_revers_
Conqueror
*******
Posts: 138



« Reply #4 on: October 18, 2015, 11:06:37 PM »

Out of curiosity - the question is still valid. Is there any way to configure compiler to have control over what it accepts and what it rejects?
No, there is no way to configure the compiler. The differences between Synthclipse and Fragmentarium which you observed come from different GLSL versions used in shaders in those apps. Fragmentarium uses probably GLSL 1.50 (OpenGL 3.2) and Synthclipse uses GLSL >= 3.3 (OpenGL >= 3.3). I've noticed that drivers often use different compiler implementations for different versions of GLSL. Some of them are more restricted than others, like in your case (warning vs error, with the same case).

In Synthclipse you can select desired GLSL version in "Window -> Preferences -> Synthclipse -> Declared GLSL version", but below 3.30 version you would need to manually change some keywords ("in", "out", "layout(location = 0)") in shaders like 3D.frag, 3D.verts to corresponding words from older GLSL version to be able to run shaders. Unfortunately Fragmentarium importer always converts shaders to GLSL 3.30.

Another question.
I've gone through manuals but couldn't find it.

In the workflows I've developed I'm importing external camera transformation matrices to set the camera in the shader to match external footage for compositing.
Essentially it's a 3x3 camera transformation position with up/right/forward vectors plus a FOV.

In Fragmentarium I applied it each frame via QScript - so in my QScript editor I had my say 1000 frames-long array of transformations and for each of frames I'd set a set a uniforms based on that data.

What would be a way to do it in Synthclipse?

You can achieve the same thing with JSX scripts. Import example from the main menu "Synthclipse -> JSX examples -> II. Synth API -> 3. Loading Fragx files'.
Add the following uniform to file "fragx/Flaring.stoy" after importing:
Code:
uniform mat3 MyCameraMatrix;
and use it somehow in that shader.

Next replace content of "loading-fragx-files.jsx" file with:
Code:

"use strict";

var fragxRenderer = null;
var renderable = {};

renderable.init = function() {
// see http://synthclipse.sourceforge.net/scripting/api/index.html?org/synthclipse/scripting/core/JSFragxRenderer.html
fragxRenderer = Synthclipse.loadFragx("fragx/Flaring.stoy");

// We can load saved preset:
fragxRenderer.loadPreset("Type 5");

// If we want to have controls in the Uniform Controls View
// we must create them explicitly:
Synthclipse.createControls(fragxRenderer);
};

renderable.display = function() {
// animation time in seconds
// see http://synthclipse.sourceforge.net/scripting/api/index.html?org/synthclipse/scripting/core/JSSynthclipse.html
var animationTime = Synthclipse.getTime();


// see http://synthclipse.sourceforge.net/scripting/api/index.html?org/synthclipse/scripting/core/JSNative.html
var cameraMatrix = Native.newMatrix3();

// first row:
cameraMatrix.m00 = 1.0 + animationTime;
cameraMatrix.m01 = 0.0;
cameraMatrix.m02 = 0.0;

// second row:
cameraMatrix.m10 = 0.0;
cameraMatrix.m11 = 1.0;
cameraMatrix.m12 = 0.0;

// Third row:
cameraMatrix.m20 = 0.0;
cameraMatrix.m21 = 0.0;
cameraMatrix.m22 = 1.0;

// IMPORTANT: Be sure the name is correct!
// Unfortunately in current version of Synthclipse
// you won't get a warning if the name is incorrect.
fragxRenderer.setUniform("MyCameraMatrix", cameraMatrix);

fragxRenderer.render();
};

renderable.resize = function(width, height) {
fragxRenderer.resize(width, height);
};

Synthclipse.setRenderable(renderable);

You will get an idea how to set uniforms in scripts.
If you want to keep your data in a separate file, you can read text files in JSX scripts using the following function:
Code:
// see http://synthclipse.sourceforge.net/scripting/api/org/synthclipse/scripting/core/JSSynthclipse.html#readFile-java.lang.String-
var textFileContent = Synthclipse.readFile("MyTextFile.txt");

As of parsing your file... JSX scripts are JavaScript scripts so please search the Web how to split Strings and casts them to Numbers in JavaScript (I'm not an JS expert).
Logged
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #5 on: October 19, 2015, 01:33:58 AM »

Fragmentarium uses probably GLSL 1.50 (OpenGL 3.2) and Synthclipse uses GLSL >= 3.3 (OpenGL >= 3.3).
... ...
Unfortunately Fragmentarium importer always converts shaders to GLSL 3.30.

GLSL versions 100 110 120 130 140 150 300 330 400 410 420 430 440 supported using the...
#version nnn
...tag as the first line in a fragment. The same applies as above for keywords. Fragmentarium defaults to 110 or your GPUs preference afaik.
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #6 on: October 19, 2015, 12:38:04 PM »

_revers_ many thanks for detailed explanation. I guess I'll find my way around now.
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #7 on: April 03, 2016, 02:43:32 PM »

You can achieve the same thing with JSX scripts. Import example from the main menu "Synthclipse -> JSX examples -> II. Synth API -> 3. Loading Fragx files'.

It does not look as if I had these. I installed 1.05.
That's what I see there (see attached).
So no direct import.

But I have a folder:
\Synthclipse\plugins\org.synthclipse.examples_1.0.4.201512310046


* Capture.JPG (41.78 KB, 527x551 - viewed 184 times.)
« Last Edit: April 03, 2016, 03:06:32 PM by Patryk Kizny » Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #8 on: April 03, 2016, 03:08:41 PM »

One more question.
I have a  large folder of my files that I used to include in fragmentarium projects.

1) Where should I put it so that it automatically became available as includes for all future projects? Or how to configure it?
2) I think these files should be processed somehow to alter uniforms metas etc.

What's the suggested workflow?
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #9 on: April 04, 2016, 12:07:49 AM »

Also, one more question regarding the JSX workflow you suggested here:
http://www.fractalforums.com/index.php?topic=22529.msg87862#msg87862

Are there any examples or could you suggest how to handle via JSX tile rendering of animation to files?
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
_revers_
Conqueror
*******
Posts: 138



« Reply #10 on: April 04, 2016, 10:59:09 PM »

>> You can achieve the same thing with JSX scripts. Import example from the main menu "Synthclipse -> JSX examples -> II. Synth API -> 3. Loading Fragx files'.

It does not look as if I had these. I installed 1.05.

It is not in the "File" (File -> Import) menu, it is in the "Synthclipse" (Synthclipse -> JSX examples -> II. Synth API -> 3. Loading Fragx files) menu smiley
Maybe I described it not clear enough.

I have a  large folder of my files that I used to include in fragmentarium projects.

1) Where should I put it so that it automatically became available as includes for all future projects? Or how to configure it?
To be available to all projects, you need to put them in eclipse\plugins\org.synthclipse.include_1.0.0\include directory.
You also can configure include paths per project (RMB on a project -> Properties -> C/C++ General -> Paths and Symbols -> Includes  -> GNU C++)


2) I think these files should be processed somehow to alter uniforms metas etc.
Yes, Fragmentarium files aren't valid Synthclipse files. You need to import them (Synthclipse -> Import -> Fragmentarium creation).

The quickest way to import all include files would be to create one Fragementarium file, put in it includes for all desired include files, e.g.:

Code:
#include "IncludeFile1.frag"
#include "IncludeFile2.frag"
#include "IncludeFile3.frag"
#include "IncludeFile4.frag"

and then import this just one file. Synthclipse automatically will import all files from "#include" directives.

Also, one more question regarding the JSX workflow you suggested here:
http://www.fractalforums.com/index.php?topic=22529.msg87862#msg87862

Are there any examples or could you suggest how to handle via JSX tile rendering of animation to files?

You can record shaders made in JSX scripts, but you cannot start or stop recording from JSX files. Recording can be only done from the Recording View, by clicking manually the "START" button.

If that is what you want, you need to set also tileable flag for any "FragxRenderer" in a JSX script, that you want to be recorded correctly with tiles. The best place for that would be the init() function, for example:
Code:
renderable.init = function() {
// see http://synthclipse.sourceforge.net/scripting/api/index.html?org/synthclipse/scripting/core/JSFragxRenderer.html
fragxRenderer = Synthclipse.loadFragx("fragx/Flaring.stoy");

// We can load saved preset:
fragxRenderer.loadPreset("Type 5");

fragxRenderer.tileable = true;

Synthclipse.createControls(fragxRenderer);
};
Logged
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #11 on: April 05, 2016, 02:09:49 AM »

Thank you very much. That's really valuable help.
Clear on importing - makes sense.

Quote
it is in the "Synthclipse" (Synthclipse -> JSX examples -> II. Synth API -> 3. Loading Fragx files) men
Either it's right in front of my eyes and I'm blind or I have some items missing in GUI.
Can you explain exactly what do you mean by "in the Synthclipse"? Is that a main menu item? Or you mean in the program folder?

As for rendering and JSX - I understand that in this case even if I run the render manually, the script will update uniforms on each frame?
I guess I can't set tile sizes via scripting nor decide the render frames range?

Another thing - my workstation has currently 3 GPUs. I understand that normally the rendering is done only by the unit that is responsible for displaying image on a particular screen. If normal rendering can't be set to multi-GPU (can it?), is it possible to make it work at least in tiled mode?

And any word on Bezier curves for 1D Uniforms animation in the timeline?

Again huge thanks for your help.
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
_revers_
Conqueror
*******
Posts: 138



« Reply #12 on: April 05, 2016, 11:02:08 PM »

Either it's right in front of my eyes and I'm blind or I have some items missing in GUI.
Can you explain exactly what do you mean by "in the Synthclipse"? Is that a main menu item? Or you mean in the program folder?
The "Synthclipse" is one of the main menu items visible at the to of Eclipse. It is visible only when the Synthclipse perspective is used.
You can see it on top of every screenshot here

As for rendering and JSX - I understand that in this case even if I run the render manually, the script will update uniforms on each frame?
Yes.

I guess I can't set tile sizes via scripting nor decide the render frames range?
Unfortunately it is not possible.

Another thing - my workstation has currently 3 GPUs. I understand that normally the rendering is done only by the unit that is responsible for displaying image on a particular screen. If normal rendering can't be set to multi-GPU (can it?), is it possible to make it work at least in tiled mode?
Tiled rendering is using only one GPU, as normal rendering.

And any word on Bezier curves for 1D Uniforms animation in the timeline?
Sorry, but I've decided to stop development of the Synthclipse for a while. With my 0.416 ( smiley ) years old kid I have very limited free time for my hobby and I'm using it for writing shaders instead of shader tools. You know how fun it is wink
Logged
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #13 on: April 22, 2016, 05:42:03 PM »

I am having a problem setting the uniforms values with jsx.
I am playing with a simple script to set uniforms in the following way:

// JSX, within renderable.display() {}
var test = Synthclipse.getTime();
fragxRenderer.setUniform("Test", test);
// Test uniform is set to float.

I am getting the error in console:
[ERROR] java.lang.ClassCastException: <D:\Work\Synthclipse\Dance\UniformTest.jsx:284:0>
java.lang.Double cannot be cast to java.lang.Float

How can I work around that?


Another problem is that whenever I type an illegal thing in jsx editor, synthclipse crashes on compile instead of saying syntax error.
Any ideas how should I be using the environement?

Thanks!
« Last Edit: April 22, 2016, 07:50:59 PM by Patryk Kizny » Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #14 on: April 22, 2016, 07:04:39 PM »

Working on a floatUniformControl, but can't get that right.

Tried also this:
// this does not throw cast error and sets the value  properly, but only in the uniform controls, without actually applying it to the program.
var time = Synthclipse.getTime();
fragxRenderer.setUniformFloat("Test", time);

And this:
//
Tried also this:
// this again causes cast error
var time = Synthclipse.getTime();
var uc = fragxRenderer.getUniformControl("Test"); // float uniform
uc.setUniformValue(time);
   

I am having undesrtanding what language jsx scripts are actually written with.
Javascript is flexible when it comes to typing and auto converts. But this fails.
On the other hand, I can't see any options on datatypes conversion or directly declaring variable as a float.

Help please.
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Pages: [1] 2   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Hi. I'm Daniel. I have some questions Meet & Greet Daniel_P 4 930 Last post January 01, 2010, 09:19:11 AM
by Nahee_Enterprises
Some Mandelbulber Questions Mandelbulber mephisto69 3 1932 Last post October 19, 2010, 02:59:05 PM
by jwm-art
Some questions Theory Cobbles 8 2412 Last post June 22, 2011, 05:51:07 PM
by Cobbles
iam new so i have some questions JWildfire Nacer 3 479 Last post November 09, 2013, 07:23:48 PM
by Nacer
2 Mandelbrot Remix Questions Mandelbrot & Julia Set MateFizyChem 4 275 Last post October 25, 2016, 11:11:04 PM
by MateFizyChem

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.133 seconds with 28 queries. (Pretty URLs adds 0.008s, 2q)