From 6f0b4678e26c04abfc88c0226c803e78a108de98 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 29 May 2014 10:56:39 -0300 Subject: 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. --- scene/resources/material.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'scene/resources/material.cpp') diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 2ddfa1078b..091a46d4ab 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -45,6 +45,7 @@ static const char*_hint_names[Material::HINT_MAX]={ "opaque_pre_zpass", "no_shadow", "no_depth_draw", + "no_alpha_depth_draw", }; static const Material::Flag _flag_indices[Material::FLAG_MAX]={ @@ -175,6 +176,7 @@ void Material::_bind_methods() { BIND_CONSTANT( HINT_OPAQUE_PRE_PASS ); BIND_CONSTANT( HINT_NO_SHADOW ); BIND_CONSTANT( HINT_NO_DEPTH_DRAW ); + BIND_CONSTANT( HINT_NO_DEPTH_DRAW_FOR_ALPHA ); BIND_CONSTANT( HINT_MAX ); BIND_CONSTANT( SHADE_MODEL_LAMBERT ); @@ -208,6 +210,7 @@ Material::Material(const RID& p_material) { for(int i=0;ifixed_material_set_flag(material,(VS::FixedMaterialFlags)p_flag,p_value); } bool FixedMaterial::get_fixed_flag(FixedFlag p_flag) const { - ERR_FAIL_INDEX_V(p_flag,3,false); + ERR_FAIL_INDEX_V(p_flag,4,false); return fixed_flags[p_flag]; } @@ -419,6 +422,7 @@ void FixedMaterial::_bind_methods() { ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "fixed_flags/use_alpha" ), _SCS("set_fixed_flag"), _SCS("get_fixed_flag"), FLAG_USE_ALPHA); ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "fixed_flags/use_color_array" ), _SCS("set_fixed_flag"), _SCS("get_fixed_flag"), FLAG_USE_COLOR_ARRAY); ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "fixed_flags/use_point_size" ), _SCS("set_fixed_flag"), _SCS("get_fixed_flag"), FLAG_USE_POINT_SIZE); + ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "fixed_flags/discard_alpha" ), _SCS("set_fixed_flag"), _SCS("get_fixed_flag"), FLAG_DISCARD_ALPHA); ADD_PROPERTYI( PropertyInfo( Variant::COLOR, "params/diffuse" ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_DIFFUSE); ADD_PROPERTYI( PropertyInfo( Variant::COLOR, "params/specular", PROPERTY_HINT_COLOR_NO_ALPHA ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SPECULAR ); ADD_PROPERTYI( PropertyInfo( Variant::COLOR, "params/emission", PROPERTY_HINT_COLOR_NO_ALPHA ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_EMISSION ); @@ -457,6 +461,7 @@ void FixedMaterial::_bind_methods() { BIND_CONSTANT( FLAG_USE_ALPHA ); BIND_CONSTANT( FLAG_USE_COLOR_ARRAY ); BIND_CONSTANT( FLAG_USE_POINT_SIZE ); + BIND_CONSTANT( FLAG_DISCARD_ALPHA ); } -- cgit v1.2.3