- Home /
Overdraw Mode
Hi Guys
I stumbled upon Overdraw mode in the editor and realised it would be a great feature for play mode. My question is if there is a convenient way of implementing overdraw mode in game from a press of a custom button.
Would appreciate any help.
Regards
Answer by tanoshimi · Feb 06, 2015 at 09:02 PM
Overdraw mode is a diagnostic tool to help you improve performance in your game by identifying those pixels in your scene that are being rendered twice (i.e. where one object is drawn on top of another).
But, if what you want is a shader that produces a similar effect when applied to a material of an object in the scene, then try this:
Shader "Overdraw" {
Properties { _MainTex ("Base", 2D) = "white" {} }
SubShader {
Fog { Mode Off }
ZWrite Off
ZTest Always
Blend One One
Pass {
SetTexture[_MainTex] {
constantColor(0.1, 0.04, 0.02, 0)
combine constant, texture
}
} // End Pass
} // End Subshader
} // End Shader
I think what the OP is asking for is an Overdraw Image Effect for his Game camera, allowing him to view his game in Play mode with the Overdraw shader.
This would be helpful because it makes it easier to diagnose overdraw problems while playing the game, from the perspective of the Game Camera.
It would also make it so that all objects are rendered this way, not just the ones with this script attached.
Does such a Camera or Image Effect exist?
Your answer
Follow this Question
Related Questions
Advice about overdraw 1 Answer
How to Make Particles Billboard Non-Square or using custom Mesh? 0 Answers
Overdraw view on specific objects? 2 Answers
Overdraw problem, how to fix it? (Android) 0 Answers
Apply a global shader 1 Answer