From f16ff2ec2e4cd2a5e73905d194414207842c9f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Sun, 19 Nov 2017 08:51:23 +0100 Subject: [PATCH] Overrides - Defining more in the script --- demo.srd | 31 +++++++++++++++++++++---------- syncoverrides.cc | 8 ++++---- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/demo.srd b/demo.srd index a4360f9..cbca145 100644 --- a/demo.srd +++ b/demo.srd @@ -69,12 +69,31 @@ (input raymarcher-correction 10) (input fog .00015) + + (ui-overrides + (section "Scenes" + (section "Raymarcher" + (int "Iterations" raymarcher-iterations + (min 1) (max 2048) (step .05)) + (float "Step size" raymarcher-step + (min 0) (max 2) (slider)) + (float "Epsilon" raymarcher-epsilon + (min 1e-10) (max 1) (power 1) + (decimals 12) (step 1e-8)) + (float "Maximal distance" raymarcher-max-dist + (min 1e-2) (max 1000000) (decimals 0) + (step .05)) + (int "Correction steps" raymarcher-correction + (min 0) (max 100) (slider)) + ) + (float "Fog" fog + (min 0) (max 1) (step .000005) (decimals 5)) + ) + ) ) (fn scene-render () (profiling "Scene render" - # FIXME temp - we'll need to do init right before this - # can be moved back to initialisation (uniforms prg-scene-p1 1 $vp-width $vp-height) (uniforms prg-scene-p1 0 $time) @@ -185,8 +204,6 @@ (profiling "Depth of Field" (use-texture 1 in-depth smp-dof) - # FIXME temp - we'll need to do init right before this - # can be moved back to initialisation (uniforms-i prg-dof-pass1 0 0) (uniforms-i prg-dof-pass1 1 1) (uniforms-i prg-dof-pass2 0 0) @@ -297,8 +314,6 @@ (fn bloom-render (in-scene) (profiling "BLOOOOM!" - # FIXME temp - we'll need to do init right before this - # can be moved back to initialisation (uniforms-i prg-bloom-highpass 0 0) (uniforms-i prg-bloom-highpass 1 0) (uniforms prg-bloom-highpass 2 $vp-width $vp-height) @@ -434,8 +449,6 @@ (fn combine-render (in-main in-bloom) (profiling "Combine" - # FIXME temp - we'll need to do init right before this - # can be moved back to initialisation (uniforms-i prg-combine 0 0) (uniforms-i prg-combine 1 1) (uniforms prg-combine 2 $vp-width $vp-height) @@ -505,8 +518,6 @@ (fn fxaa-render (in-image) (profiling "FXAA" - # FIXME temp - we'll need to do init right before this - # can be moved back to initialisation (uniforms-i prg-fxaa 0 0) (uniforms prg-fxaa 1 $vp-x $vp-y $vp-width $vp-height) diff --git a/syncoverrides.cc b/syncoverrides.cc index 04263f6..216cda5 100644 --- a/syncoverrides.cc +++ b/syncoverrides.cc @@ -153,7 +153,7 @@ bool FloatSetPower_( T_SRDParserData const& data ) { auto const& input( *( data.input ) ); const auto v( input[ 1 ].floatValue( ) ); - if ( v <= 0 ) { + if ( v == 0 ) { data.errors.add( "invalid power value" , (*data.input)[ 1 ] ); } else if ( !data.currentData->value< SP_Float >( )->setPower( v ) ) { data.errors.add( "duplicate power value" , (*data.input)[ 0 ] ); @@ -165,7 +165,7 @@ bool FloatSetDecimals_( T_SRDParserData const& data ) { auto const& input( *( data.input ) ); const auto v( input[ 1 ].longValue( ) ); - if ( v < 0 || v > 10 ) { + if ( v < 0 || v > 20 ) { data.errors.add( "invalid decimals value" , (*data.input)[ 1 ] ); } else if ( !data.currentData->value< SP_Float >( )->setDecimals( v ) ) { data.errors.add( "duplicate decimals value" , (*data.input)[ 0 ] ); @@ -393,7 +393,7 @@ bool A_Float::setStep( bool A_Float::setDecimals( const uint32_t n ) noexcept { - assert( n <= 100 ); + assert( n >= 0 && n <= 20 ); if ( decimals_ ) { return false; } @@ -412,7 +412,7 @@ bool A_Float::setDecimals( bool A_Float::setPower( const float v ) noexcept { - assert( v > 0 ); + assert( v != 0 ); M_SETOPT_( power_ , v ); }