Skip to content

Code_Configs_In_Section

Aiekick edited this page Oct 8, 2020 · 2 revisions

You have also the possibily to have In-Code Configs;, selectable for each section in a combobox in the left pane

you need to write that :

@CONFIG_START CONFIG_NAME, with config_NAMLE is what you want

put code here

@CONFIG_END

by example :

if you have a fragment code like that :

@FRAGMENT

vec3 p = vec3(0);

@CONFIG_START Scaled_1

p.y = 0.;

p.xz *= chan.r*2.0-1.0;

@CONFIG_END

@CONFIG_START Scaled_2

p.y = 0.;

p.xz *= clamp(chan.r+0.5,0.,1.);

@CONFIG_END

@CONFIG_START Elevated

p.y = chan.r * altitude ;

@CONFIG_END

by selecting Scaled_1, you will obtain :

@FRAGMENT

vec3 p = vec3(0);

p.y = 0.;

p.xz *= chan.r*2.0-1.0;

by selecting Elevated, you will obtain :

@FRAGMENT

vec3 p = vec3(0);

p.y = chan.r * altitude ;

etc..

you will ahev the choice fo each section shader type :

@UNIFORMS

@VERTEX

@FRAGMENT

@GEOMETRY

@COMPUTE

if you put config in the section @COMMON, you will have the config name where your Common Will be merged.

is he will emrge in VERTEx and FRAGMENT, you will get the choice the the both sections

see this sample if you want : FluidHeightMap

Clone this wiki locally