Sfoglia il codice sorgente

Increased depth of the example decals, and default decal depth bias.

Lasse Öörni 13 anni fa
parent
commit
29ce81ae7b

+ 1 - 1
Bin/Data/Scripts/TestScene.as

@@ -429,7 +429,7 @@ void HandleMouseButtonDown(StringHash eventType, VariantMap& eventData)
                         decal.maxVertices = 2048;
                         decal.maxIndices = 4096;
                     }
-                    decal.AddDecal(result.drawable, rayHitPos - cameraNode.worldRotation * Vector3(0, 0, 0.1),
+                    decal.AddDecal(result.drawable, rayHitPos - cameraNode.worldRotation * Vector3(0, 0, 0.5),
                         cameraNode.worldRotation, 0.5, 1.0, 1.0, Vector2(0, 0), Vector2(1, 1));
                 }
             }

+ 1 - 1
Bin/Data/Scripts/TestSceneOld.as

@@ -542,7 +542,7 @@ void HandleMouseButtonDown(StringHash eventType, VariantMap& eventData)
                         decal.maxVertices = 2048;
                         decal.maxIndices = 4096;
                     }
-                    decal.AddDecal(result.drawable, rayHitPos - cameraNode.worldRotation * Vector3(0, 0, 0.1),
+                    decal.AddDecal(result.drawable, rayHitPos - cameraNode.worldRotation * Vector3(0, 0, 0.5),
                         cameraNode.worldRotation, 0.5, 1.0, 1.0, Vector2(0, 0), Vector2(1, 1));
                 }
             }

+ 1 - 1
Engine/Engine/GraphicsAPI.cpp

@@ -758,7 +758,7 @@ static void RegisterParticleEmitter(asIScriptEngine* engine)
 static void RegisterDecalSet(asIScriptEngine* engine)
 {
     RegisterDrawable<DecalSet>(engine, "DecalSet");
-    engine->RegisterObjectMethod("DecalSet", "bool AddDecal(Drawable@+, const Vector3&in, const Quaternion&in, float, float, float, const Vector2&in, const Vector2&in, float timeToLive = 0.0, float normalCutoff = 0.25, float depthBias = 0.0005, uint subGeometry = 0xffffffff)", asMETHOD(DecalSet, AddDecal), asCALL_THISCALL);
+    engine->RegisterObjectMethod("DecalSet", "bool AddDecal(Drawable@+, const Vector3&in, const Quaternion&in, float, float, float, const Vector2&in, const Vector2&in, float timeToLive = 0.0, float normalCutoff = 0.1, float depthBias = 0.001, uint subGeometry = 0xffffffff)", asMETHOD(DecalSet, AddDecal), asCALL_THISCALL);
     engine->RegisterObjectMethod("DecalSet", "void RemoveDecals(uint)", asMETHOD(DecalSet, RemoveDecals), asCALL_THISCALL);
     engine->RegisterObjectMethod("DecalSet", "void RemoveAllDecals()", asMETHOD(DecalSet, RemoveAllDecals), asCALL_THISCALL);
     engine->RegisterObjectMethod("DecalSet", "void set_material(Material@+)", asMETHOD(DecalSet, SetMaterial), asCALL_THISCALL);

+ 1 - 1
Engine/Graphics/DecalSet.h

@@ -126,7 +126,7 @@ class DecalSet : public Drawable
     /// %Set maximum number of decal vertex indices.
     void SetMaxIndices(unsigned num);
     /// Add a decal at world coordinates, using an existing drawable's geometry for reference. Return true if successful.
-    bool AddDecal(Drawable* target, const Vector3& worldPosition, const Quaternion& worldRotation, float size, float aspectRatio, float depth, const Vector2& topLeftUV, const Vector2& bottomRightUV, float timeToLive = 0.0f, float normalCutoff = 0.25f, float depthBias = 0.0005f, unsigned subGeometry = M_MAX_UNSIGNED);
+    bool AddDecal(Drawable* target, const Vector3& worldPosition, const Quaternion& worldRotation, float size, float aspectRatio, float depth, const Vector2& topLeftUV, const Vector2& bottomRightUV, float timeToLive = 0.0f, float normalCutoff = 0.1f, float depthBias = 0.001f, unsigned subGeometry = M_MAX_UNSIGNED);
     /// Remove n oldest decals.
     void RemoveDecals(unsigned num);
     /// Remove all decals.