1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-18 14:21:41 +00:00

add ORMSpatialMaterial

This commit is contained in:
Ansraer
2024-02-08 20:10:26 +01:00
parent cc4492f9b9
commit b9cbffd957
59 changed files with 1568 additions and 1444 deletions

View File

@@ -878,7 +878,7 @@ void SpaceBullet::update_gravity() {
static ImmediateGeometry *motionVec(NULL);
static ImmediateGeometry *normalLine(NULL);
static Ref<SpatialMaterial> red_mat;
static Ref<Material3D> red_mat;
static Ref<SpatialMaterial> blue_mat;
#endif
@@ -895,21 +895,21 @@ bool SpaceBullet::test_body_motion(RigidBodyBullet *p_body, const Transform &p_f
motionVec->set_as_toplevel(true);
normalLine->set_as_toplevel(true);
red_mat = Ref<SpatialMaterial>(memnew(SpatialMaterial));
red_mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
red_mat = Ref<Material3D>(memnew(SpatialMaterial));
red_mat->set_flag(Material3D::FLAG_UNSHADED, true);
red_mat->set_line_width(20.0);
red_mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
red_mat->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
red_mat->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
red_mat->set_feature(Material3D::FEATURE_TRANSPARENT, true);
red_mat->set_flag(Material3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
red_mat->set_flag(Material3D::FLAG_SRGB_VERTEX_COLOR, true);
red_mat->set_albedo(Color(1, 0, 0, 1));
motionVec->set_material_override(red_mat);
blue_mat = Ref<SpatialMaterial>(memnew(SpatialMaterial));
blue_mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
blue_mat = Ref<Material3D>(memnew(SpatialMaterial));
blue_mat->set_flag(Material3D::FLAG_UNSHADED, true);
blue_mat->set_line_width(20.0);
blue_mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
blue_mat->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
blue_mat->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
blue_mat->set_feature(Material3D::FEATURE_TRANSPARENT, true);
blue_mat->set_flag(Material3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
blue_mat->set_flag(Material3D::FLAG_SRGB_VERTEX_COLOR, true);
blue_mat->set_albedo(Color(0, 0, 1, 1));
normalLine->set_material_override(blue_mat);
}