Overrides - Various bugs fixed, new overrides in script
This commit is contained in:
parent
aeefcbb633
commit
7d85a87488
7 changed files with 60 additions and 27 deletions
2
demo.cc
2
demo.cc
|
@ -82,6 +82,8 @@ bool T_Demo::runInit(
|
|||
context = std::move( nContext );
|
||||
|
||||
Globals::Sync( ).clearInputs( );
|
||||
Globals::Sync( ).clearOverrides( );
|
||||
|
||||
const auto n( context->initialInputs.size( ) );
|
||||
assert( n == p.inputs.size( ) );
|
||||
for ( auto i = 0u ; i < n ; i ++ ) {
|
||||
|
|
51
demo.srd
51
demo.srd
|
@ -258,10 +258,9 @@
|
|||
(pipeline pl-bloom-blur prg-fullscreen prg-bloom-blur)
|
||||
|
||||
# Inputs that control the high pass filter
|
||||
# FIXME I don't remember what they actually do, rename them later
|
||||
(input bloom-filter0 1.6)
|
||||
(input bloom-filter1 1.2)
|
||||
(input bloom-filter2 .95)
|
||||
(input bloom-power 1.6)
|
||||
(input bloom-factor 1.2)
|
||||
(input bloom-output-factor 1.05)
|
||||
|
||||
# Inputs that control the blur weights
|
||||
(input bloom-bw0 .324)
|
||||
|
@ -271,6 +270,29 @@
|
|||
|
||||
# Blur size
|
||||
(input bloom-blur-size 1.3)
|
||||
|
||||
# Input overrides
|
||||
(ui-overrides
|
||||
(section "Post-processing"
|
||||
(section "Bloom"
|
||||
(section "Input filter"
|
||||
(float "Input power" bloom-power
|
||||
(min .5) (max 4) (slider))
|
||||
(float "Input factor" bloom-factor
|
||||
(min .5) (max 4) (slider))
|
||||
(float "Output factor" bloom-output-factor
|
||||
(min .5) (max 4) (slider))
|
||||
)
|
||||
(section "Blur"
|
||||
(float "Size" bloom-blur-size
|
||||
(min .5) (max 4) (slider))
|
||||
(float4 "Weights"
|
||||
bloom-bw0 bloom-bw1 bloom-bw2 bloom-bw3
|
||||
(min 0) (max 1) (step .00005))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(fn bloom-render (in-scene)
|
||||
|
@ -286,11 +308,12 @@
|
|||
# High pass
|
||||
(use-texture 0 in-scene smp-bloom-input)
|
||||
(uniforms prg-bloom-highpass 3
|
||||
(get-input bloom-filter0)
|
||||
(get-input bloom-filter1)
|
||||
(get-input bloom-filter2)
|
||||
(get-input bloom-power)
|
||||
(get-input bloom-factor)
|
||||
(get-input bloom-output-factor)
|
||||
)
|
||||
(use-framebuffer rt-bloom1-lod0)
|
||||
(use-pipeline pl-bloom-highpass)
|
||||
(viewport 0 0 $vp-width $vp-height)
|
||||
(fullscreen)
|
||||
|
||||
|
@ -393,6 +416,20 @@
|
|||
(input cg-gamma-r 0)
|
||||
(input cg-gamma-g 0)
|
||||
(input cg-gamma-b 0)
|
||||
|
||||
# Input overrides
|
||||
(ui-overrides
|
||||
(section "Post-processing"
|
||||
(section "Bloom"
|
||||
(section "Output"
|
||||
(float "Strength" bloom-strength
|
||||
(min 0) (max 1) (slider))
|
||||
(float "Attenuation / level" bloom-attenuation
|
||||
(min 0) (max 1) (slider))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(fn combine-render (in-main in-bloom)
|
||||
|
|
|
@ -16,5 +16,5 @@ void main( void )
|
|||
gl_FragCoord.xy / u_InputSize.xy , u_LOD ).xyz;
|
||||
color = max( vec3( 0 ) ,
|
||||
( pow( c , vec3( u_FilterParams.x ) ) * u_FilterParams.y - c )
|
||||
/ u_FilterParams.z );
|
||||
* u_FilterParams.z );
|
||||
}
|
||||
|
|
18
sync.cc
18
sync.cc
|
@ -520,14 +520,8 @@ T_SyncOverrideVisitor::T_OpElement T_SyncOverrideVisitor::nodeBrowser(
|
|||
|
||||
T_SyncManager::T_SyncManager( )
|
||||
: pConfig_( MakeCurvesParser_( ) ) ,
|
||||
pdOverrides_( "default" ) ,
|
||||
soRoot_( "*root*" )
|
||||
{
|
||||
using namespace ebcl::SRD;
|
||||
pdOverrides_.context( "default" )
|
||||
<< ( Rule( ) << "section" << Text( ) << EnterContext( "section" ) );
|
||||
pdOverrides_.context( "section" );
|
||||
}
|
||||
{ }
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
|
@ -655,14 +649,10 @@ void T_SyncManager::updateValues( )
|
|||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
void T_SyncManager::registerOverrideRule(
|
||||
ebcl::T_SRDInputRule rule )
|
||||
void T_SyncManager::clearOverrides( ) noexcept
|
||||
{
|
||||
pdOverrides_.context( "section" ) << rule;
|
||||
if ( pcOverrides_ ) {
|
||||
pcOverrides_.clear( );
|
||||
}
|
||||
// pcOverrides_ = NewOwned< T_SRDParserConfig >( pdOverrides_ );
|
||||
soRoot_.subsections.clear( );
|
||||
soRoot_.overrides.clear( );
|
||||
}
|
||||
|
||||
void T_SyncManager::mergeOverrides(
|
||||
|
|
4
sync.hh
4
sync.hh
|
@ -325,7 +325,7 @@ struct T_SyncManager
|
|||
// Overrides
|
||||
|
||||
public:
|
||||
void registerOverrideRule( ebcl::T_SRDInputRule rule );
|
||||
void clearOverrides( ) noexcept;
|
||||
void mergeOverrides( T_SyncOverrideSection& overrides );
|
||||
void makeOverridesWindow( );
|
||||
|
||||
|
@ -347,7 +347,5 @@ struct T_SyncManager
|
|||
T_SyncValues values_; // Value storage
|
||||
T_SyncCurves curves_; // Curves storage
|
||||
T_Array< P_SyncCurveCache > curveCaches_; // Cache for curve segments
|
||||
ebcl::T_SRDParserDefs pdOverrides_; // Parser definitions for UI overrides
|
||||
ebcl::OP_SRDParserConfig pcOverrides_; // Parser configuration for UI overrides
|
||||
T_SyncOverrideSection soRoot_; // Root for overrides
|
||||
};
|
||||
|
|
|
@ -443,6 +443,7 @@ T_Float2::T_Float2(
|
|||
{
|
||||
inputs_.add( input0 );
|
||||
inputs_.add( input1 );
|
||||
assert( inputs_.size( ) == 2 );
|
||||
}
|
||||
|
||||
void T_Float2::makeEditWidgets(
|
||||
|
@ -480,6 +481,7 @@ T_Float3::T_Float3(
|
|||
inputs_.add( input0 );
|
||||
inputs_.add( input1 );
|
||||
inputs_.add( input2 );
|
||||
assert( inputs_.size( ) == 3 );
|
||||
}
|
||||
|
||||
void T_Float3::makeEditWidgets(
|
||||
|
@ -519,6 +521,7 @@ T_Float4::T_Float4(
|
|||
inputs_.add( input1 );
|
||||
inputs_.add( input2 );
|
||||
inputs_.add( input3 );
|
||||
assert( inputs_.size( ) == 4 );
|
||||
}
|
||||
|
||||
void T_Float4::makeEditWidgets(
|
||||
|
@ -610,6 +613,7 @@ T_Integer2::T_Integer2(
|
|||
{
|
||||
inputs_.add( input0 );
|
||||
inputs_.add( input1 );
|
||||
assert( inputs_.size( ) == 2 );
|
||||
}
|
||||
|
||||
void T_Integer2::makeEditWidgets(
|
||||
|
@ -647,6 +651,7 @@ T_Integer3::T_Integer3(
|
|||
inputs_.add( input0 );
|
||||
inputs_.add( input1 );
|
||||
inputs_.add( input2 );
|
||||
assert( inputs_.size( ) == 3 );
|
||||
}
|
||||
|
||||
void T_Integer3::makeEditWidgets(
|
||||
|
@ -686,6 +691,7 @@ T_Integer4::T_Integer4(
|
|||
inputs_.add( input1 );
|
||||
inputs_.add( input2 );
|
||||
inputs_.add( input3 );
|
||||
assert( inputs_.size( ) == 4 );
|
||||
}
|
||||
|
||||
void T_Integer4::makeEditWidgets(
|
||||
|
|
|
@ -14,7 +14,7 @@ class A_Float : public A_SyncOverride
|
|||
T_Optional< float > step_;
|
||||
T_Optional< ebcl::T_StaticArray< char , 12 > > decimals_;
|
||||
T_Optional< float > power_;
|
||||
bool slider_;
|
||||
bool slider_{ false };
|
||||
|
||||
protected:
|
||||
A_Float( char const* const type ,
|
||||
|
@ -105,7 +105,7 @@ class A_Integer : public A_SyncOverride
|
|||
T_Optional< int32_t > min_;
|
||||
T_Optional< int32_t > max_;
|
||||
T_Optional< float > step_;
|
||||
bool slider_;
|
||||
bool slider_{ false };
|
||||
|
||||
protected:
|
||||
A_Integer( char const* const type ,
|
||||
|
|
Loading…
Reference in a new issue