Welcome to Fractal Forums

Fractal Software => Fragmentarium => Topic started by: Adam Majewski on November 10, 2015, 05:45:59 PM




Title: slider
Post by: Adam Majewski on November 10, 2015, 05:45:59 PM
Hi,

I use
/Examples/Include2D.frag
in my own  frag file.

Is it possible to change initial Zoom version in my frag file ?

Definition is :
uniform float Zoom; slider[0,1,100] NotLockable

but I would like to set Zoom to 0.78

How can I do it ?

TIA

Adam


Title: Re: slider
Post by: M Benesi on November 11, 2015, 12:39:09 AM
Hi Adam,

  Try changing:

  uniform float Zoom; slider[0,1,100] NotLockable

to:

uniform float Zoom; slider[0,.78,100] NotLockable

  The middle variable is the default value.  I'm not sure if the default preset overrides it if it is the first preset in the list of presets or not... if it does, then you'll have to change the value in the preset as well.


Title: Re: slider
Post by: 3dickulus on November 11, 2015, 03:14:01 AM
Yes, the default preset is used at load time to initialize everything, once this is done other presets only need to have the uniforms you want to change.
The minimum required uniforms are what is in a "keyframe" preset, FOV, Eye, Target, Up, the engine needs at least these things to get setup and start rendering.


Title: Re: slider
Post by: M Benesi on November 11, 2015, 03:40:21 AM
Strange- I tested loading something from scratch before I posted my reply to Adam, and the default did not load when I did a build (I have autobuild off).  

 I think it loaded the default preset for the Integer Bulb, even though I built something else.  

  Edit:  No, it loads the "default" settings (middle settings in uniform definitions) in the raytracer I'm using.  Maybe if my frag had a "provides XXX" or something? 


Title: Re: slider
Post by: 3dickulus on November 11, 2015, 04:49:59 AM
I deleted all presets from Mandelbulb.frag and loaded that, it works, I thought there was a minimum requirement to start the engine  but it seems to initialize and render fine from the uniform defaults... I may have been under the wrong impression from back when I was adding spline path interface, just never tried since then.
so apparently, no presets is fine :) this might be handy when sending a frag to another machine for remote rendering...

edit:i was referring to the preset named "Default"


Title: Re: slider
Post by: Adam Majewski on November 11, 2015, 09:20:18 AM
First, goal of asking was :

can change default value of slider without changing the frag file in which this slider was defined .

( sorry if I was not clear )

What I have done :
 redefine slider in my own frag file :

 uniform float Zoom; slider[0,.78,10] NotLockable


It works , but then :
* I have 2 slider with the same name in different groups
* old slider is not working

It works but seems to be not the best solution


Title: Re: slider
Post by: 3dickulus on November 11, 2015, 09:34:37 AM
Examples/Include/2D.frag, and other 2D frags, contain the line...
Code:
uniform float Zoom; slider[0,1,100] NotLockable
that is where you should make the change
this line should not be in your own frag unless you delete or comment out the zoom line in the 2D.frag you are using.