Skip to content

Disable quad overdraw on ps4 #2107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed outlines in transitions between post-processed and plain regions in the graphics compositor (case 1278775).
- Fix decal being applied twice with LOD Crossfade.
- Fixed camera stacking for AOVs in the graphics compositor (case 1273223).
- Added a tooltip to the Micro Shadows parameters (case 1282692).
- Disable quad overdraw on ps4.

### Changed
- Preparation pass for RTSSShadows to be supported by render graph.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ The **Rendering** panel has tools that you can use to visualize various HDRP ren

| **Debug Option** | **Description** |
| ----------------------------- | ------------------------------------------------------------ |
| **Fullscreen Debug Mode** | Use the drop-down to select a rendering mode to display as an overlay on the screen.<br/>&#8226; **Motion Vectors**: Select this option to display motion vectors. Note that object motion vectors are not visible in the Scene view.<br/>&#8226; **NaN Tracker**: Select this option to display an overlay that highlights [NaN](<https://en.wikipedia.org/wiki/NaN>) values. <br/>&#8226; **Quad Overdraw**: Select this option to display an overlay that highlights gpu quads running multiple fragment shaders. This is mainly caused by small or thin triangles. Use LODs to reduce the amount of overdraw when objects are far away. (This mode is currently not supported on Metal) <br/>&#8226; **Vertex Density**: Select this option to display an overlay that highlights pixels running multiple vertex shaders. A vertex can be run multiple times when part of different triangles. This helps finding models that need LODs. (This mode is currently not supported on Metal) |
| **Fullscreen Debug Mode** | Use the drop-down to select a rendering mode to display as an overlay on the screen.<br/>&#8226; **Motion Vectors**: Select this option to display motion vectors. Note that object motion vectors are not visible in the Scene view.<br/>&#8226; **NaN Tracker**: Select this option to display an overlay that highlights [NaN](<https://en.wikipedia.org/wiki/NaN>) values. <br/>&#8226; **Quad Overdraw**: Select this option to display an overlay that highlights gpu quads running multiple fragment shaders. This is mainly caused by small or thin triangles. Use LODs to reduce the amount of overdraw when objects are far away. (This mode is currently not supported on Metal and PS4) <br/>&#8226; **Vertex Density**: Select this option to display an overlay that highlights pixels running multiple vertex shaders. A vertex can be run multiple times when part of different triangles. This helps finding models that need LODs. (This mode is currently not supported on Metal) |
| **MipMaps** | Use the drop-down to select a mipmap streaming property to debug.<br/>&#8226; **None**: Select this option to disable this debug feature.<br/>&#8226; **MipRatio**: Select this option to display a heat map of pixel to texel ratio. A blue tint represents areas with too little Texture detail (the Texture is too small). A bed tint represents areas with too much Texture detail (the Texture is too large for the screen area). If the debugger shows the original colour for a pixel, this means that the level of detail is just right.<br/>&#8226; **MipCount**: Select this option to display mip count as grayscale from black to white as the number of mips increases (for up to 14 mips, or 16K size). Red inidates Textures with more than 14 mips. Magenta indicates Textures with 0 mips or that the Shader does not support mip count.<br/>&#8226; **MipCountReduction**: Select this option to display the difference between the current mip count and the original mip count as a green scale. A brighter green represents a larger reduction (that mip streaming saves more Texture memory). Magenta means that the debugger does not know the original mip count.<br/>&#8226; **StreamingMipBudget**: Select this option to display the mip status due to streaming budget. Green means that streaming Textures saves some memory. Red means that mip levels are lower than is optimal, due to full Texture memory budget. White means that streaming Textures saves no memory.<br/>&#8226; **StreamingMip**: Select this option to display the same information as **StreamingMipBudget**, but to apply the colors to the original Textures. |
| **- Terrain Texture** | Use the drop-down to select the terrain Texture to debug the mipmap for. This property only appears when you select an option other than **None** from the **MipMaps** drop-down. |
| **Color Picker - Debug Mode** | Use the drop-down to select the format of the color picker display. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ The Render Pipeline Debug window now has a new Volume panel which you can use to
#### Quad Overdraw and Vertex Density

![quad_density](Images/quad_density_example.png)
Two full screen rendering debugs modes have been added. Quad Overdraw highlights GPU quads running multiple fragment shaders, which is mainly caused by small or thin triangles while Vertex Density displays pixels running multiple vertex shaders.
This is mainly due to Meshes far away or with too many details so it can help finding GameObjects in you scene that need LODs. (This modes are currently not supported on Metal)
To help you finding GameObjects in you scene that need LODs, HDRP includes two new full screen rendering debug modes to spot Meshes far away or with too many details.

- Quad Overdraw: highlights GPU quads running multiple fragment shaders, which is mainly caused by small or thin triangles. (Not supported on Metal and PS4)
- Vertex Density: displays pixels running multiple vertex shaders. (Not supported on Metal)

### Alpha to Mask

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,14 @@ internal DebugDisplaySettings()
FillFullScreenDebugEnum(ref s_RenderingFullScreenDebugStrings, ref s_RenderingFullScreenDebugValues, FullScreenDebugMode.MinRenderingFullScreenDebug, FullScreenDebugMode.MaxRenderingFullScreenDebug);
FillFullScreenDebugEnum(ref s_MaterialFullScreenDebugStrings, ref s_MaterialFullScreenDebugValues, FullScreenDebugMode.MinMaterialFullScreenDebug, FullScreenDebugMode.MaxMaterialFullScreenDebug);

if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Metal)
var device = SystemInfo.graphicsDeviceType;
if (device == GraphicsDeviceType.Metal)
{
// Disable QuadOverdraw and VertexDensity on metal as they are not supported
s_RenderingFullScreenDebugStrings = s_RenderingFullScreenDebugStrings.Where((val, idx) => (idx + FullScreenDebugMode.MinRenderingFullScreenDebug) != FullScreenDebugMode.VertexDensity).ToArray();
s_RenderingFullScreenDebugValues = s_RenderingFullScreenDebugValues.Where((val, idx) => (idx + FullScreenDebugMode.MinRenderingFullScreenDebug) != FullScreenDebugMode.VertexDensity).ToArray();
}
if (device == GraphicsDeviceType.Metal || device == GraphicsDeviceType.PlayStation4)
{
s_RenderingFullScreenDebugStrings = s_RenderingFullScreenDebugStrings.Where((val, idx) => (idx + FullScreenDebugMode.MinRenderingFullScreenDebug) != FullScreenDebugMode.QuadOverdraw).ToArray();
s_RenderingFullScreenDebugValues = s_RenderingFullScreenDebugValues.Where((val, idx) => (idx + FullScreenDebugMode.MinRenderingFullScreenDebug) != FullScreenDebugMode.QuadOverdraw).ToArray();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ PackedVaryingsToPS VertTesselation(VaryingsToDS input)
[earlydepthstencil] // quad overshading debug mode writes to UAV
#endif
void Frag(PackedVaryingsToPS packedInput
#if !defined(SHADER_API_METAL) // Metal does not support SV_PrimitiveID
#if !defined(SHADER_API_METAL) && !defined(SHADER_API_PSSL) // Metal and pssl does not support SV_PrimitiveID
, uint primitiveID : SV_PrimitiveID
#endif
)
Expand All @@ -44,7 +44,7 @@ void Frag(PackedVaryingsToPS packedInput

if (_DebugFullScreenMode == FULLSCREENDEBUGMODE_QUAD_OVERDRAW)
{
#if !defined(SHADER_API_METAL) // Metal does not support SV_PrimitiveID
#if !defined(SHADER_API_METAL) && !defined(SHADER_API_PSSL) // Metal and pssl does not support SV_PrimitiveID
IncrementQuadOverdrawCounter(posInput.positionSS.xy, primitiveID);
#endif
}
Expand Down