Преглед изворни кода

let me underscore this is painfully incorrect and we'll want to revisit it when we have more time, but... this seems to fix mangled decal and decalroad rendering

AzaezelX пре 3 година
родитељ
комит
66820fee90
2 измењених фајлова са 4 додато и 1 уклоњено
  1. 1 0
      Engine/source/T3D/decal/decalManager.cpp
  2. 3 1
      Engine/source/environment/decalRoad.cpp

+ 1 - 0
Engine/source/T3D/decal/decalManager.cpp

@@ -1425,6 +1425,7 @@ void DecalManager::prepRenderImage( SceneRenderState* state )
       ri->prim->numPrimitives = currentBatch->iCount / 3;
       ri->prim->numPrimitives = currentBatch->iCount / 3;
       ri->prim->startVertex = 0;
       ri->prim->startVertex = 0;
       ri->prim->numVertices = currentBatch->vCount;
       ri->prim->numVertices = currentBatch->vCount;
+      ri->translucentSort = !currentBatch->matInst->getMaterial()->isTranslucent();
 
 
       // Ugly hack for ProjectedShadow!
       // Ugly hack for ProjectedShadow!
       if ( customTex )
       if ( customTex )

+ 3 - 1
Engine/source/environment/decalRoad.cpp

@@ -734,7 +734,7 @@ void DecalRoad::prepRenderImage( SceneRenderState* state )
    coreRI.sortDistSq = F32_MAX;
    coreRI.sortDistSq = F32_MAX;
 
 
 	// If we need lights then set them up.
 	// If we need lights then set them up.
-   if ( matInst->isForwardLit() )
+   if ( matInst->isForwardLit() && !coreRI.lights[0])
    {
    {
       LightQuery query;
       LightQuery query;
       query.init( getWorldSphere() );
       query.init( getWorldSphere() );
@@ -784,6 +784,7 @@ void DecalRoad::prepRenderImage( SceneRenderState* state )
 
 
       *ri = coreRI;
       *ri = coreRI;
 
 
+      ri->matInst = matInst;
       ri->prim = renderPass->allocPrim();
       ri->prim = renderPass->allocPrim();
       ri->prim->type = GFXTriangleList;
       ri->prim->type = GFXTriangleList;
       ri->prim->minIndex = 0;
       ri->prim->minIndex = 0;
@@ -791,6 +792,7 @@ void DecalRoad::prepRenderImage( SceneRenderState* state )
       ri->prim->numPrimitives = triangleCount;
       ri->prim->numPrimitives = triangleCount;
       ri->prim->startVertex = 0;
       ri->prim->startVertex = 0;
       ri->prim->numVertices = endBatch.endVert + 1;
       ri->prim->numVertices = endBatch.endVert + 1;
+      ri->translucentSort = !matInst->getMaterial()->isTranslucent();
 
 
       // For sorting we first sort by render priority
       // For sorting we first sort by render priority
       // and then by objectId. 
       // and then by objectId.