33 #include "scene/3d/visual_instance.h" 34 #include "scene/resources/texture.h" 35 #include "servers/visual_server.h" 43 OBJ_CATEGORY(
"3D Light Nodes");
48 PARAM_RADIUS=VisualServer::LIGHT_PARAM_RADIUS,
49 PARAM_ENERGY=VisualServer::LIGHT_PARAM_ENERGY,
50 PARAM_ATTENUATION=VisualServer::LIGHT_PARAM_ATTENUATION,
51 PARAM_SPOT_ANGLE=VisualServer::LIGHT_PARAM_SPOT_ANGLE,
52 PARAM_SPOT_ATTENUATION=VisualServer::LIGHT_PARAM_SPOT_ATTENUATION,
53 PARAM_SHADOW_DARKENING=VisualServer::LIGHT_PARAM_SHADOW_DARKENING,
54 PARAM_SHADOW_Z_OFFSET=VisualServer::LIGHT_PARAM_SHADOW_Z_OFFSET,
55 PARAM_SHADOW_Z_SLOPE_SCALE=VisualServer::LIGHT_PARAM_SHADOW_Z_SLOPE_SCALE,
56 PARAM_SHADOW_ESM_MULTIPLIER=VisualServer::LIGHT_PARAM_SHADOW_ESM_MULTIPLIER,
57 PARAM_SHADOW_BLUR_PASSES=VisualServer::LIGHT_PARAM_SHADOW_BLUR_PASSES,
58 PARAM_MAX=VisualServer::LIGHT_PARAM_MAX
64 COLOR_DIFFUSE=VisualServer::LIGHT_COLOR_DIFFUSE,
65 COLOR_SPECULAR=VisualServer::LIGHT_COLOR_SPECULAR
72 BAKE_MODE_INDIRECT_AND_SHADOWS,
87 float vars[PARAM_MAX];
92 VisualServer::LightType type;
98 void _update_visibility();
105 virtual bool _can_gizmo_scale()
const;
106 virtual RES _get_gizmo_geometry()
const;
108 static void _bind_methods();
109 void _notification(
int p_what);
112 Light(VisualServer::LightType p_type);
115 VS::LightType get_light_type()
const {
return type; }
117 void set_parameter(Parameter p_var,
float p_value);
118 float get_parameter(Parameter p_var)
const;
120 void set_color(LightColor p_color,
const Color& p_value);
121 Color get_color(LightColor p_color)
const;
123 void set_project_shadows(
bool p_enabled);
124 bool has_project_shadows()
const;
129 void set_operator(Operator p_op);
130 Operator get_operator()
const;
132 void set_bake_mode(BakeMode p_bake_mode);
133 BakeMode get_bake_mode()
const;
135 void set_enabled(
bool p_enabled);
136 bool is_enabled()
const;
138 void set_editor_only(
bool p_editor_only);
139 bool is_editor_only()
const;
141 virtual AABB get_aabb()
const;
144 void approximate_opengl_attenuation(
float p_constant,
float p_linear,
float p_quadratic,
float p_radius_treshold=0.5);
151 VARIANT_ENUM_CAST( Light::Parameter );
152 VARIANT_ENUM_CAST( Light::LightColor );
153 VARIANT_ENUM_CAST( Light::Operator );
154 VARIANT_ENUM_CAST( Light::BakeMode);
166 SHADOW_PARALLEL_2_SPLITS,
167 SHADOW_PARALLEL_4_SPLITS
170 SHADOW_PARAM_MAX_DISTANCE,
171 SHADOW_PARAM_PSSM_SPLIT_WEIGHT,
172 SHADOW_PARAM_PSSM_ZOFFSET_SCALE
176 ShadowMode shadow_mode;
177 float shadow_param[3];
179 static void _bind_methods();
182 void set_shadow_mode(ShadowMode p_mode);
183 ShadowMode get_shadow_mode()
const;
185 void set_shadow_max_distance(
float p_distance);
186 float get_shadow_max_distance()
const;
187 void set_shadow_param(ShadowParam p_param,
float p_value);
188 float get_shadow_param(ShadowParam p_param)
const;
193 VARIANT_ENUM_CAST( DirectionalLight::ShadowMode );
194 VARIANT_ENUM_CAST( DirectionalLight::ShadowParam );
201 static void _bind_methods();
206 OmniLight() :
Light( VisualServer::LIGHT_OMNI ) { set_parameter(PARAM_SHADOW_Z_OFFSET,0.001);}
213 static void _bind_methods();
Definition: visual_instance.h:39