Merge pull request #82413 from Calinou/3d-editor-gizmos-ignore-fog
Make 3D editor gizmos and debug shapes ignore fog
This commit is contained in:
commit
3228f73127
15 changed files with 68 additions and 17 deletions
|
@ -1556,6 +1556,7 @@ SceneImportSettings::SceneImportSettings() {
|
|||
Ref<StandardMaterial3D> selection_mat;
|
||||
selection_mat.instantiate();
|
||||
selection_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
selection_mat->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
selection_mat->set_albedo(Color(1, 0.8, 1.0));
|
||||
|
||||
Ref<SurfaceTool> st;
|
||||
|
@ -1597,6 +1598,7 @@ SceneImportSettings::SceneImportSettings() {
|
|||
{
|
||||
collider_mat.instantiate();
|
||||
collider_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
collider_mat->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
collider_mat->set_albedo(Color(0.5, 0.5, 1.0));
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ LightmapGIGizmoPlugin::LightmapGIGizmoPlugin() {
|
|||
mat->set_cull_mode(StandardMaterial3D::CULL_DISABLED);
|
||||
mat->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
mat->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, false);
|
||||
mat->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
|
||||
add_material("lightmap_probe_material", mat);
|
||||
|
||||
|
|
|
@ -85,6 +85,7 @@ Marker3DGizmoPlugin::Marker3DGizmoPlugin() {
|
|||
mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
mat->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
mat->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
|
||||
mat->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
|
||||
Array d;
|
||||
|
|
|
@ -546,6 +546,7 @@ NavigationObstacle3DEditor::NavigationObstacle3DEditor() {
|
|||
line_material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
line_material->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
line_material->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
|
||||
line_material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
line_material->set_albedo(Color(1, 1, 1));
|
||||
|
||||
handle_material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D));
|
||||
|
@ -554,6 +555,7 @@ NavigationObstacle3DEditor::NavigationObstacle3DEditor() {
|
|||
handle_material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
handle_material->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
handle_material->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
|
||||
handle_material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
Ref<Texture2D> handle = EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Editor3DHandle"), EditorStringName(EditorIcons));
|
||||
handle_material->set_point_size(handle->get_width());
|
||||
handle_material->set_texture(StandardMaterial3D::TEXTURE_ALBEDO, handle);
|
||||
|
|
|
@ -876,6 +876,7 @@ void EditorNode3DGizmoPlugin::create_material(const String &p_name, const Color
|
|||
material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
material->set_render_priority(StandardMaterial3D::RENDER_PRIORITY_MIN + 1);
|
||||
material->set_cull_mode(StandardMaterial3D::CULL_DISABLED);
|
||||
material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
|
||||
if (p_use_vertex_color) {
|
||||
material->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
|
@ -918,6 +919,7 @@ void EditorNode3DGizmoPlugin::create_icon_material(const String &p_name, const R
|
|||
icon->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
icon->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
icon->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
|
||||
icon->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
icon->set_cull_mode(StandardMaterial3D::CULL_DISABLED);
|
||||
icon->set_depth_draw_mode(StandardMaterial3D::DEPTH_DRAW_DISABLED);
|
||||
icon->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
|
@ -947,6 +949,7 @@ void EditorNode3DGizmoPlugin::create_handle_material(const String &p_name, bool
|
|||
handle_material->set_albedo(Color(1, 1, 1));
|
||||
handle_material->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
handle_material->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
|
||||
handle_material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
handle_material->set_on_top_of_alpha();
|
||||
if (p_billboard) {
|
||||
handle_material->set_billboard_mode(StandardMaterial3D::BILLBOARD_ENABLED);
|
||||
|
|
|
@ -5832,6 +5832,7 @@ void Node3DEditor::_generate_selection_boxes() {
|
|||
|
||||
Ref<StandardMaterial3D> mat = memnew(StandardMaterial3D);
|
||||
mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
mat->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
const Color selection_box_color = EDITOR_GET("editors/3d/selection_box_color");
|
||||
mat->set_albedo(selection_box_color);
|
||||
mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
|
@ -5840,6 +5841,7 @@ void Node3DEditor::_generate_selection_boxes() {
|
|||
|
||||
Ref<StandardMaterial3D> mat_xray = memnew(StandardMaterial3D);
|
||||
mat_xray->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
mat_xray->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
mat_xray->set_flag(StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST, true);
|
||||
mat_xray->set_albedo(selection_box_color * Color(1, 1, 1, 0.15));
|
||||
mat_xray->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
|
@ -6484,6 +6486,7 @@ void Node3DEditor::_init_indicators() {
|
|||
indicator_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
indicator_mat->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
indicator_mat->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
|
||||
indicator_mat->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
indicator_mat->set_transparency(StandardMaterial3D::Transparency::TRANSPARENCY_ALPHA_DEPTH_PRE_PASS);
|
||||
|
||||
Vector<Color> origin_colors;
|
||||
|
@ -6541,7 +6544,7 @@ void Node3DEditor::_init_indicators() {
|
|||
|
||||
shader_type spatial;
|
||||
|
||||
render_mode unshaded;
|
||||
render_mode unshaded, fog_disabled;
|
||||
|
||||
uniform bool orthogonal;
|
||||
uniform float grid_size;
|
||||
|
@ -6638,6 +6641,7 @@ void fragment() {
|
|||
|
||||
Ref<StandardMaterial3D> mat = memnew(StandardMaterial3D);
|
||||
mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
mat->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
mat->set_on_top_of_alpha();
|
||||
mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
mat->set_albedo(col);
|
||||
|
@ -6722,6 +6726,7 @@ void fragment() {
|
|||
|
||||
Ref<StandardMaterial3D> plane_mat = memnew(StandardMaterial3D);
|
||||
plane_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
plane_mat->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
plane_mat->set_on_top_of_alpha();
|
||||
plane_mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
plane_mat->set_cull_mode(StandardMaterial3D::CULL_DISABLED);
|
||||
|
@ -6782,7 +6787,7 @@ void fragment() {
|
|||
|
||||
shader_type spatial;
|
||||
|
||||
render_mode unshaded, depth_test_disabled;
|
||||
render_mode unshaded, depth_test_disabled, fog_disabled;
|
||||
|
||||
uniform vec4 albedo;
|
||||
|
||||
|
@ -6790,14 +6795,14 @@ mat3 orthonormalize(mat3 m) {
|
|||
vec3 x = normalize(m[0]);
|
||||
vec3 y = normalize(m[1] - x * dot(x, m[1]));
|
||||
vec3 z = m[2] - x * dot(x, m[2]);
|
||||
z = normalize(z - y * (dot(y,m[2])));
|
||||
z = normalize(z - y * (dot(y, m[2])));
|
||||
return mat3(x,y,z);
|
||||
}
|
||||
|
||||
void vertex() {
|
||||
mat3 mv = orthonormalize(mat3(MODELVIEW_MATRIX));
|
||||
vec3 n = mv * VERTEX;
|
||||
float orientation = dot(vec3(0, 0, -1), n);
|
||||
float orientation = dot(vec3(0.0, 0.0, -1.0), n);
|
||||
if (orientation <= 0.005) {
|
||||
VERTEX += NORMAL * 0.02;
|
||||
}
|
||||
|
@ -6832,7 +6837,7 @@ void fragment() {
|
|||
|
||||
shader_type spatial;
|
||||
|
||||
render_mode unshaded, depth_test_disabled;
|
||||
render_mode unshaded, depth_test_disabled, fog_disabled;
|
||||
|
||||
uniform vec4 albedo;
|
||||
|
||||
|
@ -6840,16 +6845,16 @@ mat3 orthonormalize(mat3 m) {
|
|||
vec3 x = normalize(m[0]);
|
||||
vec3 y = normalize(m[1] - x * dot(x, m[1]));
|
||||
vec3 z = m[2] - x * dot(x, m[2]);
|
||||
z = normalize(z - y * (dot(y,m[2])));
|
||||
return mat3(x,y,z);
|
||||
z = normalize(z - y * (dot(y, m[2])));
|
||||
return mat3(x, y, z);
|
||||
}
|
||||
|
||||
void vertex() {
|
||||
mat3 mv = orthonormalize(mat3(MODELVIEW_MATRIX));
|
||||
mv = inverse(mv);
|
||||
VERTEX += NORMAL*0.008;
|
||||
vec3 camera_dir_local = mv * vec3(0,0,1);
|
||||
vec3 camera_up_local = mv * vec3(0,1,0);
|
||||
VERTEX += NORMAL * 0.008;
|
||||
vec3 camera_dir_local = mv * vec3(0.0, 0.0, 1.0);
|
||||
vec3 camera_up_local = mv * vec3(0.0, 1.0, 0.0);
|
||||
mat3 rotation_matrix = mat3(cross(camera_dir_local, camera_up_local), camera_up_local, camera_dir_local);
|
||||
VERTEX = rotation_matrix * VERTEX;
|
||||
}
|
||||
|
@ -6944,6 +6949,7 @@ void fragment() {
|
|||
|
||||
Ref<StandardMaterial3D> plane_mat = memnew(StandardMaterial3D);
|
||||
plane_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
plane_mat->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
plane_mat->set_on_top_of_alpha();
|
||||
plane_mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
plane_mat->set_cull_mode(StandardMaterial3D::CULL_DISABLED);
|
||||
|
|
|
@ -561,6 +561,7 @@ Polygon3DEditor::Polygon3DEditor() {
|
|||
line_material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
line_material->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
line_material->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
|
||||
line_material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
line_material->set_albedo(Color(1, 1, 1));
|
||||
|
||||
handle_material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D));
|
||||
|
@ -569,6 +570,7 @@ Polygon3DEditor::Polygon3DEditor() {
|
|||
handle_material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
handle_material->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
handle_material->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
|
||||
handle_material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
Ref<Texture2D> handle = EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Editor3DHandle"), EditorStringName(EditorIcons));
|
||||
handle_material->set_point_size(handle->get_width());
|
||||
handle_material->set_texture(StandardMaterial3D::TEXTURE_ALBEDO, handle);
|
||||
|
|
|
@ -916,24 +916,32 @@ Skeleton3DEditor::Skeleton3DEditor(EditorInspectorPluginSkeleton *e_plugin, Skel
|
|||
// Skeleton 3D gizmo handle shader.
|
||||
|
||||
shader_type spatial;
|
||||
render_mode unshaded, shadows_disabled, depth_draw_always;
|
||||
render_mode unshaded, shadows_disabled, depth_draw_always, fog_disabled;
|
||||
|
||||
uniform sampler2D texture_albedo : source_color;
|
||||
uniform float point_size : hint_range(0,128) = 32;
|
||||
uniform float point_size : hint_range(0, 128) = 32;
|
||||
|
||||
void vertex() {
|
||||
if (!OUTPUT_IS_SRGB) {
|
||||
COLOR.rgb = mix( pow((COLOR.rgb + vec3(0.055)) * (1.0 / (1.0 + 0.055)), vec3(2.4)), COLOR.rgb* (1.0 / 12.92), lessThan(COLOR.rgb,vec3(0.04045)) );
|
||||
COLOR.rgb = mix(pow((COLOR.rgb + vec3(0.055)) * (1.0 / (1.0 + 0.055)), vec3(2.4)), COLOR.rgb * (1.0 / 12.92), lessThan(COLOR.rgb, vec3(0.04045)));
|
||||
}
|
||||
|
||||
VERTEX = VERTEX;
|
||||
POSITION = PROJECTION_MATRIX * VIEW_MATRIX * MODEL_MATRIX * vec4(VERTEX.xyz, 1.0);
|
||||
POSITION.z = mix(POSITION.z, 0, 0.999);
|
||||
POSITION.z = mix(POSITION.z, 0.0, 0.999);
|
||||
POINT_SIZE = point_size;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
vec4 albedo_tex = texture(texture_albedo,POINT_COORD);
|
||||
vec4 albedo_tex = texture(texture_albedo, POINT_COORD);
|
||||
vec3 col = albedo_tex.rgb + COLOR.rgb;
|
||||
col = vec3(min(col.r,1.0),min(col.g,1.0),min(col.b,1.0));
|
||||
col = vec3(min(col.r, 1.0), min(col.g, 1.0), min(col.b, 1.0));
|
||||
ALBEDO = col;
|
||||
if (albedo_tex.a < 0.5) { discard; }
|
||||
|
||||
if (albedo_tex.a < 0.5) {
|
||||
discard;
|
||||
}
|
||||
|
||||
ALPHA = albedo_tex.a;
|
||||
}
|
||||
)");
|
||||
|
@ -1184,6 +1192,7 @@ Skeleton3DGizmoPlugin::Skeleton3DGizmoPlugin() {
|
|||
unselected_mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
unselected_mat->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
unselected_mat->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
|
||||
unselected_mat->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
|
||||
selected_mat = Ref<ShaderMaterial>(memnew(ShaderMaterial));
|
||||
selected_sh = Ref<Shader>(memnew(Shader));
|
||||
|
|
|
@ -1412,6 +1412,7 @@ GridMapEditor::GridMapEditor() {
|
|||
inner_mat.instantiate();
|
||||
inner_mat->set_albedo(Color(0.7, 0.7, 1.0, 0.2));
|
||||
inner_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
inner_mat->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
inner_mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
|
||||
d[RS::ARRAY_VERTEX] = triangles;
|
||||
|
@ -1424,11 +1425,13 @@ GridMapEditor::GridMapEditor() {
|
|||
|
||||
outer_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
outer_mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
outer_mat->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
|
||||
selection_floor_mat.instantiate();
|
||||
selection_floor_mat->set_albedo(Color(0.80, 0.80, 1.0, 1));
|
||||
selection_floor_mat->set_on_top_of_alpha();
|
||||
selection_floor_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
selection_floor_mat->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
|
||||
d[RS::ARRAY_VERTEX] = lines;
|
||||
RenderingServer::get_singleton()->mesh_add_surface_from_arrays(selection_mesh, RS::PRIMITIVE_LINES, d);
|
||||
|
@ -1457,6 +1460,7 @@ GridMapEditor::GridMapEditor() {
|
|||
indicator_mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
indicator_mat->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
|
||||
indicator_mat->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
indicator_mat->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
indicator_mat->set_albedo(Color(0.8, 0.5, 0.1));
|
||||
}
|
||||
|
||||
|
|
|
@ -458,6 +458,7 @@ MeshInstance3D *MeshInstance3D::create_debug_tangents_node() {
|
|||
sm->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
sm->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
|
||||
sm->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
sm->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
|
||||
Ref<ArrayMesh> am;
|
||||
am.instantiate();
|
||||
|
|
|
@ -463,6 +463,7 @@ void RayCast3D::_update_debug_shape_material(bool p_check_collision) {
|
|||
debug_material = material;
|
||||
|
||||
material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
// Use double-sided rendering so that the RayCast can be seen if the camera is inside.
|
||||
material->set_cull_mode(BaseMaterial3D::CULL_DISABLED);
|
||||
material->set_transparency(BaseMaterial3D::TRANSPARENCY_ALPHA);
|
||||
|
|
|
@ -547,6 +547,7 @@ void ShapeCast3D::_update_debug_shape_material(bool p_check_collision) {
|
|||
debug_material = material;
|
||||
|
||||
material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
// Use double-sided rendering so that the RayCast can be seen if the camera is inside.
|
||||
material->set_cull_mode(BaseMaterial3D::CULL_DISABLED);
|
||||
material->set_transparency(BaseMaterial3D::TRANSPARENCY_ALPHA);
|
||||
|
|
|
@ -990,6 +990,7 @@ Ref<MultiMesh> Voxelizer::create_debug_multimesh() {
|
|||
fsm->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
|
||||
fsm->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
fsm->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
fsm->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
fsm->set_albedo(Color(1, 1, 1, 1));
|
||||
|
||||
mesh->surface_set_material(0, fsm);
|
||||
|
|
|
@ -789,6 +789,7 @@ Ref<Material> SceneTree::get_debug_paths_material() {
|
|||
_debug_material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
_debug_material->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
|
||||
_debug_material->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
_debug_material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
_debug_material->set_albedo(get_debug_paths_color());
|
||||
|
||||
debug_paths_material = _debug_material;
|
||||
|
@ -808,6 +809,7 @@ Ref<Material> SceneTree::get_debug_collision_material() {
|
|||
line_material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
line_material->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
|
||||
line_material->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
line_material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
line_material->set_albedo(get_debug_collisions_color());
|
||||
|
||||
collision_material = line_material;
|
||||
|
@ -829,6 +831,7 @@ Ref<ArrayMesh> SceneTree::get_debug_contact_mesh() {
|
|||
mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
mat->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
|
||||
mat->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
mat->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
mat->set_albedo(get_debug_collision_contact_color());
|
||||
|
||||
Vector3 diamond[6] = {
|
||||
|
|
|
@ -301,6 +301,7 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_geometry_face_m
|
|||
face_material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
face_material->set_albedo(get_debug_navigation_geometry_face_color());
|
||||
face_material->set_cull_mode(StandardMaterial3D::CULL_DISABLED);
|
||||
face_material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
if (enabled_geometry_face_random_color) {
|
||||
face_material->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
|
||||
face_material->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
|
||||
|
@ -321,6 +322,7 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_geometry_edge_m
|
|||
Ref<StandardMaterial3D> line_material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D));
|
||||
line_material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
line_material->set_albedo(get_debug_navigation_geometry_edge_color());
|
||||
line_material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
if (enabled_edge_lines_xray) {
|
||||
line_material->set_flag(StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST, true);
|
||||
}
|
||||
|
@ -339,6 +341,7 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_geometry_face_d
|
|||
face_disabled_material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
face_disabled_material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
face_disabled_material->set_albedo(get_debug_navigation_geometry_face_disabled_color());
|
||||
face_disabled_material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
|
||||
debug_navigation_geometry_face_disabled_material = face_disabled_material;
|
||||
|
||||
|
@ -355,6 +358,7 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_geometry_edge_d
|
|||
Ref<StandardMaterial3D> line_disabled_material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D));
|
||||
line_disabled_material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
line_disabled_material->set_albedo(get_debug_navigation_geometry_edge_disabled_color());
|
||||
line_disabled_material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
if (enabled_edge_lines_xray) {
|
||||
line_disabled_material->set_flag(StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST, true);
|
||||
}
|
||||
|
@ -374,6 +378,7 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_edge_connection
|
|||
Ref<StandardMaterial3D> edge_connections_material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D));
|
||||
edge_connections_material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
edge_connections_material->set_albedo(get_debug_navigation_edge_connection_color());
|
||||
edge_connections_material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
if (enabled_edge_connections_xray) {
|
||||
edge_connections_material->set_flag(StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST, true);
|
||||
}
|
||||
|
@ -392,6 +397,7 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_link_connection
|
|||
Ref<StandardMaterial3D> material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D));
|
||||
material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
material->set_albedo(debug_navigation_link_connection_color);
|
||||
material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
if (debug_navigation_enable_link_connections_xray) {
|
||||
material->set_flag(StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST, true);
|
||||
}
|
||||
|
@ -409,6 +415,7 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_link_connection
|
|||
Ref<StandardMaterial3D> material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D));
|
||||
material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
material->set_albedo(debug_navigation_link_connection_disabled_color);
|
||||
material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
if (debug_navigation_enable_link_connections_xray) {
|
||||
material->set_flag(StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST, true);
|
||||
}
|
||||
|
@ -427,6 +434,7 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_agent_path_line
|
|||
material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
|
||||
material->set_albedo(debug_navigation_agent_path_color);
|
||||
material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
if (debug_navigation_enable_agent_paths_xray) {
|
||||
material->set_flag(StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST, true);
|
||||
}
|
||||
|
@ -445,6 +453,7 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_agent_path_poin
|
|||
material->set_albedo(debug_navigation_agent_path_color);
|
||||
material->set_flag(StandardMaterial3D::FLAG_USE_POINT_SIZE, true);
|
||||
material->set_point_size(debug_navigation_agent_path_point_size);
|
||||
material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
if (debug_navigation_enable_agent_paths_xray) {
|
||||
material->set_flag(StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST, true);
|
||||
}
|
||||
|
@ -476,6 +485,7 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_avoidance_obsta
|
|||
|
||||
Ref<StandardMaterial3D> material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D));
|
||||
material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
material->set_cull_mode(StandardMaterial3D::CULL_DISABLED);
|
||||
material->set_albedo(debug_navigation_avoidance_obstacles_radius_color);
|
||||
|
@ -492,6 +502,7 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_avoidance_stati
|
|||
|
||||
Ref<StandardMaterial3D> material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D));
|
||||
material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
material->set_cull_mode(StandardMaterial3D::CULL_DISABLED);
|
||||
material->set_albedo(debug_navigation_avoidance_static_obstacle_pushin_face_color);
|
||||
|
@ -508,6 +519,7 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_avoidance_stati
|
|||
|
||||
Ref<StandardMaterial3D> material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D));
|
||||
material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
material->set_cull_mode(StandardMaterial3D::CULL_DISABLED);
|
||||
material->set_albedo(debug_navigation_avoidance_static_obstacle_pushout_face_color);
|
||||
|
@ -524,6 +536,7 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_avoidance_stati
|
|||
|
||||
Ref<StandardMaterial3D> material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D));
|
||||
material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
//material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
//material->set_cull_mode(StandardMaterial3D::CULL_DISABLED);
|
||||
material->set_albedo(debug_navigation_avoidance_static_obstacle_pushin_edge_color);
|
||||
|
@ -541,6 +554,7 @@ Ref<StandardMaterial3D> NavigationServer3D::get_debug_navigation_avoidance_stati
|
|||
|
||||
Ref<StandardMaterial3D> material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D));
|
||||
material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
|
||||
material->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);
|
||||
///material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
|
||||
//material->set_cull_mode(StandardMaterial3D::CULL_DISABLED);
|
||||
material->set_albedo(debug_navigation_avoidance_static_obstacle_pushout_edge_color);
|
||||
|
|
Loading…
Reference in a new issue