diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-05-29 10:56:39 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-05-29 10:56:39 -0300 |
commit | 6f0b4678e26c04abfc88c0226c803e78a108de98 (patch) | |
tree | 51b99b2ece75e5782c0b14c97bb6913c48e7f363 /scene/resources/environment.cpp | |
parent | d9adf2627a70ab37408aca9ae4140c6280dfe6df (diff) | |
download | redot-engine-6f0b4678e26c04abfc88c0226c803e78a108de98.tar.gz |
More 3D Improvements
-=-=-=-=-=-=-=-=-=-=
-Sprite3D and AnimatedSprite3D support.
-Opaque pre-pass works, is compatible with shadows
-Improved shadow map rendering (can differentiate between plain opaque and opaque with shaders/discard/etc)
-Added option to use alpha discard in FixedMaterial
-Improved Glow FX, many more options (three modes, Additive, Screen and SoftLight), strength and scale
-Ability for Background (image or cubemap) to send to glow buffer
-Dumb Deploy of clients now actually works in Android
-Many Many rendering fixes, 3D is much more usable now.
Diffstat (limited to 'scene/resources/environment.cpp')
-rw-r--r-- | scene/resources/environment.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index 0c55d22dbe..99447c0a0e 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -109,9 +109,13 @@ void Environment::_bind_methods() { ADD_PROPERTYI( PropertyInfo(Variant::OBJECT,"background/cubemap",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_background_param"),_SCS("get_background_param"), BG_PARAM_CUBEMAP); ADD_PROPERTYI( PropertyInfo(Variant::REAL,"background/energy",PROPERTY_HINT_RANGE,"0,128,0.01"),_SCS("set_background_param"),_SCS("get_background_param"), BG_PARAM_ENERGY); ADD_PROPERTYI( PropertyInfo(Variant::REAL,"background/scale",PROPERTY_HINT_RANGE,"0.001,16,0.001"),_SCS("set_background_param"),_SCS("get_background_param"), BG_PARAM_SCALE); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"background/glow",PROPERTY_HINT_RANGE,"0.00,8,0.01"),_SCS("set_background_param"),_SCS("get_background_param"), BG_PARAM_GLOW); ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"glow/enabled"),_SCS("set_enable_fx"),_SCS("is_fx_enabled"), FX_GLOW); ADD_PROPERTYI( PropertyInfo(Variant::INT,"glow/blur_passes",PROPERTY_HINT_RANGE,"1,4,1"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_GLOW_BLUR_PASSES); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"glow/blur_scale",PROPERTY_HINT_RANGE,"0.01,4,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_GLOW_BLUR_SCALE); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"glow/blur_strength",PROPERTY_HINT_RANGE,"0.01,4,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_GLOW_BLUR_STRENGTH); + ADD_PROPERTYI( PropertyInfo(Variant::INT,"glow/blur_blend_mode",PROPERTY_HINT_ENUM,"Additive,Screen,SoftLight"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_GLOW_BLUR_BLEND_MODE); ADD_PROPERTYI( PropertyInfo(Variant::REAL,"glow/bloom",PROPERTY_HINT_RANGE,"0,8,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_GLOW_BLOOM); ADD_PROPERTYI( PropertyInfo(Variant::REAL,"glow/bloom_treshold",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_GLOW_BLOOM_TRESHOLD); ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"dof_blur/enabled"),_SCS("set_enable_fx"),_SCS("is_fx_enabled"), FX_DOF_BLUR); @@ -180,6 +184,7 @@ void Environment::_bind_methods() { BIND_CONSTANT( BG_PARAM_TEXTURE ); BIND_CONSTANT( BG_PARAM_CUBEMAP ); BIND_CONSTANT( BG_PARAM_ENERGY ); + BIND_CONSTANT( BG_PARAM_GLOW ); BIND_CONSTANT( BG_PARAM_MAX ); @@ -193,7 +198,14 @@ void Environment::_bind_methods() { BIND_CONSTANT( FX_MAX ); + BIND_CONSTANT( FX_BLUR_BLEND_MODE_ADDITIVE ); + BIND_CONSTANT( FX_BLUR_BLEND_MODE_SCREEN ); + BIND_CONSTANT( FX_BLUR_BLEND_MODE_SOFTLIGHT ); + BIND_CONSTANT( FX_PARAM_GLOW_BLUR_PASSES ); + BIND_CONSTANT( FX_PARAM_GLOW_BLUR_SCALE ); + BIND_CONSTANT( FX_PARAM_GLOW_BLUR_STRENGTH ); + BIND_CONSTANT( FX_PARAM_GLOW_BLUR_BLEND_MODE ); BIND_CONSTANT( FX_PARAM_GLOW_BLOOM); BIND_CONSTANT( FX_PARAM_GLOW_BLOOM_TRESHOLD); BIND_CONSTANT( FX_PARAM_DOF_BLUR_PASSES ); @@ -229,11 +241,14 @@ Environment::Environment() { set_background_param(BG_PARAM_CUBEMAP,Ref<CubeMap>()); set_background_param(BG_PARAM_ENERGY,1.0); set_background_param(BG_PARAM_SCALE,1.0); + set_background_param(BG_PARAM_GLOW,0.0); for(int i=0;i<FX_MAX;i++) set_enable_fx(Fx(i),false); fx_set_param(FX_PARAM_GLOW_BLUR_PASSES,1); + fx_set_param(FX_PARAM_GLOW_BLUR_SCALE,1); + fx_set_param(FX_PARAM_GLOW_BLUR_STRENGTH,1); fx_set_param(FX_PARAM_GLOW_BLOOM,0.0); fx_set_param(FX_PARAM_GLOW_BLOOM_TRESHOLD,0.5); fx_set_param(FX_PARAM_DOF_BLUR_PASSES,1); |