Quellcode durchsuchen

Added back polygon fill mode.

Lasse Öörni vor 13 Jahren
Ursprung
Commit
c64dfb114e

+ 6 - 0
Bin/Data/Scripts/Editor/EditorUI.as

@@ -551,6 +551,12 @@ void HandleKeyDown(StringHash eventType, VariantMap& eventData)
             if (pickMode >= MAX_PICK_MODES)
             if (pickMode >= MAX_PICK_MODES)
                 pickMode = PICK_GEOMETRIES;
                 pickMode = PICK_GEOMETRIES;
         }
         }
+        else if (key == '7')
+        {
+            fillMode = FillMode(fillMode + 1);
+            if (fillMode > FILL_POINT)
+                fillMode = FILL_SOLID;
+        }
         else
         else
             SteppedObjectManipulation(key);
             SteppedObjectManipulation(key);
     }
     }

+ 11 - 0
Bin/Data/Scripts/Editor/EditorView.as

@@ -23,6 +23,7 @@ Text@ cameraPosText;
 
 
 EditMode editMode = EDIT_MOVE;
 EditMode editMode = EDIT_MOVE;
 AxisMode axisMode = AXIS_WORLD;
 AxisMode axisMode = AXIS_WORLD;
+FillMode fillMode = FILL_SOLID;
 
 
 float cameraBaseSpeed = 10;
 float cameraBaseSpeed = 10;
 float cameraBaseRotationSpeed = 0.2;
 float cameraBaseRotationSpeed = 0.2;
@@ -65,6 +66,12 @@ Array<String> pickModeText = {
     "Rigidbodies"
     "Rigidbodies"
 };
 };
 
 
+Array<String> fillModeText = {
+    "Solid",
+    "Wire",
+    "Point"
+};
+
 void CreateCamera()
 void CreateCamera()
 {
 {
     // Note: the camera will not be bound into the scene, so that it is not listed, and does not get deleted
     // Note: the camera will not be bound into the scene, so that it is not listed, and does not get deleted
@@ -125,6 +132,7 @@ void UpdateStats(float timeStep)
         "Mode: " + editModeText[editMode] +
         "Mode: " + editModeText[editMode] +
         "  Axis: " + axisModeText[axisMode] +
         "  Axis: " + axisModeText[axisMode] +
         "  Pick: " + pickModeText[pickMode] +
         "  Pick: " + pickModeText[pickMode] +
+        "  Fill: " + fillModeText[fillMode] +
         "  Updates: " + (runUpdate ? "Running" : "Paused"));
         "  Updates: " + (runUpdate ? "Running" : "Paused"));
 
 
     renderStatsText.text = String(
     renderStatsText.text = String(
@@ -247,6 +255,9 @@ void MoveCamera(float timeStep)
     // Update audio listener
     // Update audio listener
     audio.listenerPosition = cameraNode.position;
     audio.listenerPosition = cameraNode.position;
     audio.listenerRotation = cameraNode.rotation;
     audio.listenerRotation = cameraNode.rotation;
+    
+    // Update camera fill mode
+    camera.fillMode = fillMode;
 }
 }
 
 
 void SteppedObjectManipulation(int key)
 void SteppedObjectManipulation(int key)

+ 1 - 0
Docs/GettingStarted.dox

@@ -603,6 +603,7 @@ Ctrl+1,2,3      - Select manipulation mode: move/rotate/scale
 Ctrl+4          - Toggle between world and local axes manipulation
 Ctrl+4          - Toggle between world and local axes manipulation
 Ctrl+5,6        - Cycle through components to pick: geometries, lights, zones,
 Ctrl+5,6        - Cycle through components to pick: geometries, lights, zones,
                   collision shapes
                   collision shapes
+Ctrl+7          - Cycle through solid, wireframe and point rendering
 Ctrl+arrows     - Manipulate node in X & Z directions
 Ctrl+arrows     - Manipulate node in X & Z directions
 Ctrl+pgup/pgdn  - Manipulate node in Y direction
 Ctrl+pgup/pgdn  - Manipulate node in Y direction
 Ctrl+plus/minus - Scale node uniformly (scale mode only)
 Ctrl+plus/minus - Scale node uniformly (scale mode only)

+ 2 - 0
Docs/Reference.dox

@@ -572,6 +572,8 @@ OpenGL ES 2.0 has further limitations:
 
 
 - %Light pre-pass and deferred rendering are not supported due to missing multiple rendertarget support, and limited rendertarget formats.
 - %Light pre-pass and deferred rendering are not supported due to missing multiple rendertarget support, and limited rendertarget formats.
 
 
+- Wireframe and point fill modes are not supported.
+
 - Due to texture unit limit (usually 8), point light shadow maps are not supported.
 - Due to texture unit limit (usually 8), point light shadow maps are not supported.
 
 
 - To reduce fillrate, the stencil buffer is not reserved and the stencil test is not available. As a consequence, the light stencil masking optimization is not used.
 - To reduce fillrate, the stencil buffer is not reserved and the stencil test is not available. As a consequence, the light stencil masking optimization is not used.

+ 1 - 0
Docs/ScriptAPI.dox

@@ -1531,6 +1531,7 @@ Properties:<br>
 - Vector2 projectionOffset
 - Vector2 projectionOffset
 - uint viewMask
 - uint viewMask
 - uint viewOverrideFlags
 - uint viewOverrideFlags
+- FillMode fillMode
 - Frustum frustum (readonly)
 - Frustum frustum (readonly)
 - Matrix4 projection (readonly)
 - Matrix4 projection (readonly)
 - Matrix3x4 inverseWorldTransform (readonly)
 - Matrix3x4 inverseWorldTransform (readonly)

+ 7 - 0
Engine/Engine/GraphicsAPI.cpp

@@ -60,6 +60,11 @@ static void RegisterCamera(asIScriptEngine* engine)
     engine->RegisterGlobalProperty("const uint VO_DISABLE_SHADOWS", (void*)&VO_DISABLE_SHADOWS);
     engine->RegisterGlobalProperty("const uint VO_DISABLE_SHADOWS", (void*)&VO_DISABLE_SHADOWS);
     engine->RegisterGlobalProperty("const uint VO_DISABLE_OCCLUSION", (void*)&VO_DISABLE_OCCLUSION);
     engine->RegisterGlobalProperty("const uint VO_DISABLE_OCCLUSION", (void*)&VO_DISABLE_OCCLUSION);
     
     
+    engine->RegisterEnum("FillMode");
+    engine->RegisterEnumValue("FillMode", "FILL_SOLID", FILL_SOLID);
+    engine->RegisterEnumValue("FillMode", "FILL_WIREFRAME", FILL_WIREFRAME);
+    engine->RegisterEnumValue("FillMode", "FILL_POINT", FILL_POINT);
+    
     RegisterComponent<Camera>(engine, "Camera");
     RegisterComponent<Camera>(engine, "Camera");
     engine->RegisterObjectMethod("Camera", "void SetOrthoSize(const Vector2&in)", asMETHODPR(Camera, SetOrthoSize, (const Vector2&), void), asCALL_THISCALL);
     engine->RegisterObjectMethod("Camera", "void SetOrthoSize(const Vector2&in)", asMETHODPR(Camera, SetOrthoSize, (const Vector2&), void), asCALL_THISCALL);
     engine->RegisterObjectMethod("Camera", "Frustum GetSplitFrustum(float, float) const", asMETHOD(Camera, GetSplitFrustum), asCALL_THISCALL);
     engine->RegisterObjectMethod("Camera", "Frustum GetSplitFrustum(float, float) const", asMETHOD(Camera, GetSplitFrustum), asCALL_THISCALL);
@@ -90,6 +95,8 @@ static void RegisterCamera(asIScriptEngine* engine)
     engine->RegisterObjectMethod("Camera", "uint get_viewMask() const", asMETHOD(Camera, GetViewMask), asCALL_THISCALL);
     engine->RegisterObjectMethod("Camera", "uint get_viewMask() const", asMETHOD(Camera, GetViewMask), asCALL_THISCALL);
     engine->RegisterObjectMethod("Camera", "void set_viewOverrideFlags(uint)", asMETHOD(Camera, SetViewOverrideFlags), asCALL_THISCALL);
     engine->RegisterObjectMethod("Camera", "void set_viewOverrideFlags(uint)", asMETHOD(Camera, SetViewOverrideFlags), asCALL_THISCALL);
     engine->RegisterObjectMethod("Camera", "uint get_viewOverrideFlags() const", asMETHOD(Camera, GetViewOverrideFlags), asCALL_THISCALL);
     engine->RegisterObjectMethod("Camera", "uint get_viewOverrideFlags() const", asMETHOD(Camera, GetViewOverrideFlags), asCALL_THISCALL);
+    engine->RegisterObjectMethod("Camera", "void set_fillMode(FillMode)", asMETHOD(Camera, SetFillMode), asCALL_THISCALL);
+    engine->RegisterObjectMethod("Camera", "FillMode get_fillMode() const", asMETHOD(Camera, GetFillMode), asCALL_THISCALL);
     engine->RegisterObjectMethod("Camera", "const Frustum& get_frustum() const", asMETHOD(Camera, GetFrustum), asCALL_THISCALL);
     engine->RegisterObjectMethod("Camera", "const Frustum& get_frustum() const", asMETHOD(Camera, GetFrustum), asCALL_THISCALL);
     engine->RegisterObjectMethod("Camera", "const Matrix4& get_projection() const", asMETHODPR(Camera, GetProjection, () const, const Matrix4&), asCALL_THISCALL);
     engine->RegisterObjectMethod("Camera", "const Matrix4& get_projection() const", asMETHODPR(Camera, GetProjection, () const, const Matrix4&), asCALL_THISCALL);
     engine->RegisterObjectMethod("Camera", "const Matrix3x4& get_inverseWorldTransform() const", asMETHOD(Camera, GetInverseWorldTransform), asCALL_THISCALL);
     engine->RegisterObjectMethod("Camera", "const Matrix3x4& get_inverseWorldTransform() const", asMETHOD(Camera, GetInverseWorldTransform), asCALL_THISCALL);

+ 16 - 0
Engine/Graphics/Camera.cpp

@@ -34,6 +34,14 @@ static const float DEFAULT_FARCLIP = 1000.0f;
 static const float DEFAULT_FOV = 45.0f;
 static const float DEFAULT_FOV = 45.0f;
 static const float DEFAULT_ORTHOSIZE = 20.0f;
 static const float DEFAULT_ORTHOSIZE = 20.0f;
 
 
+static const char* fillModeNames[] =
+{
+    "Solid",
+    "Wireframe",
+    "Point",
+    0
+};
+
 static const Matrix4 flipMatrix(
 static const Matrix4 flipMatrix(
     1.0f, 0.0f, 0.0f, 0.0f,
     1.0f, 0.0f, 0.0f, 0.0f,
     0.0f, -1.0f, 0.0f, 0.0f,
     0.0f, -1.0f, 0.0f, 0.0f,
@@ -58,6 +66,7 @@ Camera::Camera(Context* context) :
     lodBias_(1.0f),
     lodBias_(1.0f),
     viewMask_(DEFAULT_VIEWMASK),
     viewMask_(DEFAULT_VIEWMASK),
     viewOverrideFlags_(VO_NONE),
     viewOverrideFlags_(VO_NONE),
+    fillMode_(FILL_SOLID),
     projectionOffset_(Vector2::ZERO),
     projectionOffset_(Vector2::ZERO),
     autoAspectRatio_(true),
     autoAspectRatio_(true),
     flipVertical_(false)
     flipVertical_(false)
@@ -76,6 +85,7 @@ void Camera::RegisterObject(Context* context)
     ACCESSOR_ATTRIBUTE(Camera, VAR_FLOAT, "Far Clip", GetFarClip, SetFarClip, float, DEFAULT_FARCLIP, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(Camera, VAR_FLOAT, "Far Clip", GetFarClip, SetFarClip, float, DEFAULT_FARCLIP, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(Camera, VAR_FLOAT, "FOV", GetFov, SetFov, float, DEFAULT_FOV, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(Camera, VAR_FLOAT, "FOV", GetFov, SetFov, float, DEFAULT_FOV, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(Camera, VAR_FLOAT, "Aspect Ratio", GetAspectRatio, SetAspectRatio, float, 1.0f, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(Camera, VAR_FLOAT, "Aspect Ratio", GetAspectRatio, SetAspectRatio, float, 1.0f, AM_DEFAULT);
+    ENUM_ATTRIBUTE(Camera, "Fill Mode", fillMode_, fillModeNames, FILL_SOLID, AM_DEFAULT);
     ATTRIBUTE(Camera, VAR_BOOL, "Auto Aspect Ratio", autoAspectRatio_, true, AM_DEFAULT);
     ATTRIBUTE(Camera, VAR_BOOL, "Auto Aspect Ratio", autoAspectRatio_, true, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(Camera, VAR_BOOL, "Orthographic", IsOrthographic, SetOrthographic, bool, false, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(Camera, VAR_BOOL, "Orthographic", IsOrthographic, SetOrthographic, bool, false, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(Camera, VAR_FLOAT, "Orthographic Size", GetOrthoSize, SetOrthoSize, float, DEFAULT_ORTHOSIZE, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(Camera, VAR_FLOAT, "Orthographic Size", GetOrthoSize, SetOrthoSize, float, DEFAULT_ORTHOSIZE, AM_DEFAULT);
@@ -162,6 +172,12 @@ void Camera::SetViewOverrideFlags(unsigned flags)
     MarkNetworkUpdate();
     MarkNetworkUpdate();
 }
 }
 
 
+void Camera::SetFillMode(FillMode mode)
+{
+    fillMode_ = mode;
+    MarkNetworkUpdate();
+}
+
 void Camera::SetOrthographic(bool enable)
 void Camera::SetOrthographic(bool enable)
 {
 {
     orthographic_ = enable;
     orthographic_ = enable;

+ 7 - 0
Engine/Graphics/Camera.h

@@ -25,6 +25,7 @@
 
 
 #include "Frustum.h"
 #include "Frustum.h"
 #include "Component.h"
 #include "Component.h"
+#include "GraphicsDefs.h"
 #include "Ray.h"
 #include "Ray.h"
 
 
 static const unsigned VO_NONE = 0x0;
 static const unsigned VO_NONE = 0x0;
@@ -57,6 +58,8 @@ public:
     void SetOrthoSize(const Vector2& orthoSize);
     void SetOrthoSize(const Vector2& orthoSize);
     /// Set aspect ratio.
     /// Set aspect ratio.
     void SetAspectRatio(float aspectRatio);
     void SetAspectRatio(float aspectRatio);
+    /// Set polygon fill mode to use when rendering a scene.
+    void SetFillMode(FillMode mode);
     /// Set zoom.
     /// Set zoom.
     void SetZoom(float zoom);
     void SetZoom(float zoom);
     /// Set LOD bias.
     /// Set LOD bias.
@@ -92,6 +95,8 @@ public:
     unsigned GetViewMask() const { return viewMask_; }
     unsigned GetViewMask() const { return viewMask_; }
     /// Return view override flags.
     /// Return view override flags.
     unsigned GetViewOverrideFlags() const { return viewOverrideFlags_; }
     unsigned GetViewOverrideFlags() const { return viewOverrideFlags_; }
+    /// Return fill mode.
+    FillMode GetFillMode() const { return fillMode_; }
     /// Return orthographic flag.
     /// Return orthographic flag.
     bool IsOrthographic() const { return orthographic_; }
     bool IsOrthographic() const { return orthographic_; }
     /// Return auto aspect ratio flag.
     /// Return auto aspect ratio flag.
@@ -175,6 +180,8 @@ private:
     unsigned viewMask_;
     unsigned viewMask_;
     /// View override flags.
     /// View override flags.
     unsigned viewOverrideFlags_;
     unsigned viewOverrideFlags_;
+    /// Fill mode.
+    FillMode fillMode_;
     /// Projection offset.
     /// Projection offset.
     Vector2 projectionOffset_;
     Vector2 projectionOffset_;
     /// Auto aspect ratio flag.
     /// Auto aspect ratio flag.

+ 16 - 0
Engine/Graphics/Direct3D9/D3D9Graphics.cpp

@@ -135,6 +135,13 @@ static const D3DCULL d3dCullMode[] =
     D3DCULL_CW
     D3DCULL_CW
 };
 };
 
 
+static const D3DFILLMODE d3dFillMode[] =
+{
+    D3DFILL_SOLID,
+    D3DFILL_WIREFRAME,
+    D3DFILL_POINT
+};
+
 static const D3DSTENCILOP d3dStencilOp[] =
 static const D3DSTENCILOP d3dStencilOp[] =
 {
 {
     D3DSTENCILOP_KEEP,
     D3DSTENCILOP_KEEP,
@@ -1506,6 +1513,14 @@ void Graphics::SetDepthWrite(bool enable)
         depthWrite_ = enable;
         depthWrite_ = enable;
     }
     }
 }
 }
+void Graphics::SetFillMode(FillMode mode)
+{
+    if (mode != fillMode_)
+    {
+        impl_->device_->SetRenderState(D3DRS_FILLMODE, d3dFillMode[mode]);
+        fillMode_ = mode;
+    }
+}
 
 
 void Graphics::SetScissorTest(bool enable, const Rect& rect, bool borderInclusive)
 void Graphics::SetScissorTest(bool enable, const Rect& rect, bool borderInclusive)
 {
 {
@@ -2234,6 +2249,7 @@ void Graphics::ResetCachedState()
     slopeScaledDepthBias_ = 0.0f;
     slopeScaledDepthBias_ = 0.0f;
     depthTestMode_ = CMP_LESSEQUAL;
     depthTestMode_ = CMP_LESSEQUAL;
     depthWrite_ = true;
     depthWrite_ = true;
+    fillMode_ = FILL_SOLID;
     scissorTest_ = false;
     scissorTest_ = false;
     scissorRect_ = IntRect::ZERO;
     scissorRect_ = IntRect::ZERO;
     stencilTest_ = false;
     stencilTest_ = false;

+ 6 - 0
Engine/Graphics/Direct3D9/D3D9Graphics.h

@@ -181,6 +181,8 @@ public:
     void SetDepthTest(CompareMode mode);
     void SetDepthTest(CompareMode mode);
     /// Set depth write on/off.
     /// Set depth write on/off.
     void SetDepthWrite(bool enable);
     void SetDepthWrite(bool enable);
+    /// Set polygon fill mode.
+    void SetFillMode(FillMode mode);
     /// Set scissor test.
     /// Set scissor test.
     void SetScissorTest(bool enable, const Rect& rect = Rect::FULL, bool borderInclusive = true);
     void SetScissorTest(bool enable, const Rect& rect = Rect::FULL, bool borderInclusive = true);
     /// Set scissor test.
     /// Set scissor test.
@@ -284,6 +286,8 @@ public:
     CompareMode GetDepthTest() const { return depthTestMode_; }
     CompareMode GetDepthTest() const { return depthTestMode_; }
     /// Return whether depth write is enabled.
     /// Return whether depth write is enabled.
     bool GetDepthWrite() const { return depthWrite_; }
     bool GetDepthWrite() const { return depthWrite_; }
+    /// Return polygon fill mode.
+    FillMode GetFillMode() const { return fillMode_; }
     /// Return whether stencil test is enabled.
     /// Return whether stencil test is enabled.
     bool GetStencilTest() const { return stencilTest_; }
     bool GetStencilTest() const { return stencilTest_; }
     /// Return whether scissor test is enabled.
     /// Return whether scissor test is enabled.
@@ -465,6 +469,8 @@ private:
     CompareMode depthTestMode_;
     CompareMode depthTestMode_;
     /// Depth write enable flag.
     /// Depth write enable flag.
     bool depthWrite_;
     bool depthWrite_;
+    /// Polygon fill mode.
+    FillMode fillMode_;
     /// Scissor test rectangle.
     /// Scissor test rectangle.
     IntRect scissorRect_;
     IntRect scissorRect_;
     /// Scissor test enable flag.
     /// Scissor test enable flag.

+ 8 - 0
Engine/Graphics/GraphicsDefs.h

@@ -87,6 +87,14 @@ enum CullMode
     MAX_CULLMODES
     MAX_CULLMODES
 };
 };
 
 
+/// Fill mode.
+enum FillMode
+{
+    FILL_SOLID = 0,
+    FILL_WIREFRAME,
+	FILL_POINT
+};
+
 /// Stencil operation.
 /// Stencil operation.
 enum StencilOp
 enum StencilOp
 {
 {

+ 19 - 0
Engine/Graphics/OpenGL/OGLGraphics.cpp

@@ -109,6 +109,13 @@ static const unsigned glDestBlend[] =
     GL_DST_ALPHA
     GL_DST_ALPHA
 };
 };
 
 
+static const unsigned glFillMode[] =
+{
+    GL_FILL,
+    GL_LINE,
+    GL_POINT
+};
+
 static const unsigned glStencilOps[] =
 static const unsigned glStencilOps[] =
 {
 {
     GL_KEEP,
     GL_KEEP,
@@ -1437,6 +1444,17 @@ void Graphics::SetDepthWrite(bool enable)
     }
     }
 }
 }
 
 
+void Graphics::SetFillMode(FillMode mode)
+{
+    #ifndef GL_ES_VERSION_2_0
+    if (mode != fillMode_)
+    {
+        glPolygonMode(GL_FRONT_AND_BACK, glFillMode[mode]);
+        fillMode_ = mode;
+    }
+    #endif
+}
+
 void Graphics::SetScissorTest(bool enable, const Rect& rect, bool borderInclusive)
 void Graphics::SetScissorTest(bool enable, const Rect& rect, bool borderInclusive)
 {
 {
     // During some light rendering loops, a full rect is toggled on/off repeatedly.
     // During some light rendering loops, a full rect is toggled on/off repeatedly.
@@ -2287,6 +2305,7 @@ void Graphics::ResetCachedState()
     slopeScaledDepthBias_ = 0.0f;
     slopeScaledDepthBias_ = 0.0f;
     depthTestMode_ = CMP_ALWAYS;
     depthTestMode_ = CMP_ALWAYS;
     depthWrite_ = false;
     depthWrite_ = false;
+    fillMode_ = FILL_SOLID;
     scissorTest_ = false;
     scissorTest_ = false;
     scissorRect_ = IntRect::ZERO;
     scissorRect_ = IntRect::ZERO;
     stencilTest_ = false;
     stencilTest_ = false;

+ 6 - 0
Engine/Graphics/OpenGL/OGLGraphics.h

@@ -190,6 +190,8 @@ public:
     void SetDepthTest(CompareMode mode);
     void SetDepthTest(CompareMode mode);
     /// Set depth write on/off.
     /// Set depth write on/off.
     void SetDepthWrite(bool enable);
     void SetDepthWrite(bool enable);
+    /// Set polygon fill mode.
+    void SetFillMode(FillMode mode);
     /// Set scissor test.
     /// Set scissor test.
     void SetScissorTest(bool enable, const Rect& rect = Rect::FULL, bool borderInclusive = true);
     void SetScissorTest(bool enable, const Rect& rect = Rect::FULL, bool borderInclusive = true);
     /// Set scissor test.
     /// Set scissor test.
@@ -297,6 +299,8 @@ public:
     CompareMode GetDepthTest() const { return depthTestMode_; }
     CompareMode GetDepthTest() const { return depthTestMode_; }
     /// Return whether depth write is enabled.
     /// Return whether depth write is enabled.
     bool GetDepthWrite() const { return depthWrite_; }
     bool GetDepthWrite() const { return depthWrite_; }
+    /// Return polygon fill mode.
+    FillMode GetFillMode() const { return fillMode_; }
     /// Return whether stencil test is enabled.
     /// Return whether stencil test is enabled.
     bool GetStencilTest() const { return stencilTest_; }
     bool GetStencilTest() const { return stencilTest_; }
     /// Return whether scissor test is enabled.
     /// Return whether scissor test is enabled.
@@ -462,6 +466,8 @@ private:
     CompareMode depthTestMode_;
     CompareMode depthTestMode_;
     /// Depth write enable flag.
     /// Depth write enable flag.
     bool depthWrite_;
     bool depthWrite_;
+    /// Polygon fill mode.
+    FillMode fillMode_;
     /// Scissor test rectangle.
     /// Scissor test rectangle.
     IntRect scissorRect_;
     IntRect scissorRect_;
     /// Scissor test enable flag.
     /// Scissor test enable flag.

+ 17 - 0
Engine/Graphics/View.cpp

@@ -1189,6 +1189,8 @@ void View::RenderBatchesForward()
     graphics_->Clear(CLEAR_COLOR | CLEAR_DEPTH, farClipZone_->GetFogColor());
     graphics_->Clear(CLEAR_COLOR | CLEAR_DEPTH, farClipZone_->GetFogColor());
     #endif
     #endif
     
     
+    graphics_->SetFillMode(camera_->GetFillMode());
+    
     // Render opaque object unlit base pass
     // Render opaque object unlit base pass
     if (!baseQueue_.IsEmpty())
     if (!baseQueue_.IsEmpty())
     {
     {
@@ -1210,6 +1212,7 @@ void View::RenderBatchesForward()
                 graphics_->SetRenderTarget(0, renderTarget);
                 graphics_->SetRenderTarget(0, renderTarget);
                 graphics_->SetDepthStencil(depthStencil);
                 graphics_->SetDepthStencil(depthStencil);
                 graphics_->SetViewport(viewRect_);
                 graphics_->SetViewport(viewRect_);
+                graphics_->SetFillMode(camera_->GetFillMode());
             }
             }
             
             
             i->litBatches_.Draw(i->light_, graphics_, renderer_);
             i->litBatches_.Draw(i->light_, graphics_, renderer_);
@@ -1226,6 +1229,7 @@ void View::RenderBatchesForward()
     graphics_->SetColorWrite(true);
     graphics_->SetColorWrite(true);
     graphics_->SetDepthTest(CMP_LESSEQUAL);
     graphics_->SetDepthTest(CMP_LESSEQUAL);
     graphics_->SetDepthWrite(false);
     graphics_->SetDepthWrite(false);
+    graphics_->SetFillMode(FILL_SOLID);
     graphics_->SetScissorTest(false);
     graphics_->SetScissorTest(false);
     graphics_->SetStencilTest(false);
     graphics_->SetStencilTest(false);
     graphics_->SetShaders(renderer_->GetVertexShader("Basic"), renderer_->GetPixelShader("Basic"));
     graphics_->SetShaders(renderer_->GetVertexShader("Basic"), renderer_->GetPixelShader("Basic"));
@@ -1234,6 +1238,8 @@ void View::RenderBatchesForward()
     DrawFullscreenQuad(camera_, false);
     DrawFullscreenQuad(camera_, false);
     #endif
     #endif
     
     
+    graphics_->SetFillMode(camera_->GetFillMode());
+    
     // Render pre-alpha custom pass
     // Render pre-alpha custom pass
     if (!preAlphaQueue_.IsEmpty())
     if (!preAlphaQueue_.IsEmpty())
     {
     {
@@ -1255,6 +1261,8 @@ void View::RenderBatchesForward()
         postAlphaQueue_.Draw(graphics_, renderer_);
         postAlphaQueue_.Draw(graphics_, renderer_);
     }
     }
     
     
+    graphics_->SetFillMode(FILL_SOLID);
+    
     // Resolve multisampled backbuffer now if necessary
     // Resolve multisampled backbuffer now if necessary
     if (resolve)
     if (resolve)
         graphics_->ResolveToTexture(screenBuffers_[0], viewRect_);
         graphics_->ResolveToTexture(screenBuffers_[0], viewRect_);
@@ -1303,6 +1311,8 @@ void View::RenderBatchesDeferred()
     graphics_->SetViewport(viewRect_);
     graphics_->SetViewport(viewRect_);
     graphics_->Clear(CLEAR_DEPTH | CLEAR_STENCIL);
     graphics_->Clear(CLEAR_DEPTH | CLEAR_STENCIL);
     
     
+    graphics_->SetFillMode(camera_->GetFillMode());
+    
     // Render G-buffer batches
     // Render G-buffer batches
     if (!gbufferQueue_.IsEmpty())
     if (!gbufferQueue_.IsEmpty())
     {
     {
@@ -1310,6 +1320,8 @@ void View::RenderBatchesDeferred()
         gbufferQueue_.Draw(graphics_, renderer_, false, true);
         gbufferQueue_.Draw(graphics_, renderer_, false, true);
     }
     }
     
     
+    graphics_->SetFillMode(FILL_SOLID);
+    
     // Clear the light accumulation buffer (light pre-pass only.) However, skip the clear if the first light is a directional
     // Clear the light accumulation buffer (light pre-pass only.) However, skip the clear if the first light is a directional
     // light with full mask
     // light with full mask
     RenderSurface* lightRenderTarget = renderMode_ == RENDER_PREPASS ? albedoBuffer->GetRenderSurface() : renderTarget;
     RenderSurface* lightRenderTarget = renderMode_ == RENDER_PREPASS ? albedoBuffer->GetRenderSurface() : renderTarget;
@@ -1384,6 +1396,8 @@ void View::RenderBatchesDeferred()
     graphics_->ClearParameterSource(SP_MATERIAL);
     graphics_->ClearParameterSource(SP_MATERIAL);
     DrawFullscreenQuad(camera_, false);
     DrawFullscreenQuad(camera_, false);
     
     
+    graphics_->SetFillMode(camera_->GetFillMode());
+    
     // Render opaque objects with deferred lighting result (light pre-pass only)
     // Render opaque objects with deferred lighting result (light pre-pass only)
     if (!baseQueue_.IsEmpty())
     if (!baseQueue_.IsEmpty())
     {
     {
@@ -1414,6 +1428,8 @@ void View::RenderBatchesDeferred()
         PROFILE(RenderPostAlpha);
         PROFILE(RenderPostAlpha);
         postAlphaQueue_.Draw(graphics_, renderer_);
         postAlphaQueue_.Draw(graphics_, renderer_);
     }
     }
+    
+    graphics_->SetFillMode(FILL_SOLID);
 }
 }
 
 
 void View::AllocateScreenBuffers()
 void View::AllocateScreenBuffers()
@@ -2487,6 +2503,7 @@ void View::RenderShadowMap(const LightBatchQueue& queue)
     graphics_->SetTexture(TU_SHADOWMAP, 0);
     graphics_->SetTexture(TU_SHADOWMAP, 0);
     
     
     graphics_->SetColorWrite(false);
     graphics_->SetColorWrite(false);
+    graphics_->SetFillMode(FILL_SOLID);
     graphics_->SetStencilTest(false);
     graphics_->SetStencilTest(false);
     graphics_->SetRenderTarget(0, shadowMap->GetRenderSurface()->GetLinkedRenderTarget());
     graphics_->SetRenderTarget(0, shadowMap->GetRenderSurface()->GetLinkedRenderTarget());
     graphics_->SetDepthStencil(shadowMap);
     graphics_->SetDepthStencil(shadowMap);