Skip to content

Commit

Permalink
[2021.2] Quality Audit: Material, Camera and Lighting Tooltips (Unity…
Browse files Browse the repository at this point in the history
…-Technologies#4998)

* Updated BaseShaderGui tooltip

* Updated Specular map tooltip

* Updated tooltip for normal map and height map

* Added tooltips for emission and details

* Added tooltips for heigh map, camera FOV and particle shader vertex streams

* Updated camera tooltips

* Updated depth bias and particle shader vertex stream tooltips

* Rephrased detail input tooltip

* Updated to use EditorGUIUtility

* Moved inline GUI content to styles

Co-authored-by: Jonas Mortensen <jonas.mortensen@unity3d.com>
  • Loading branch information
Jonasmortensen and Jonasmortensen committed Jul 7, 2021
1 parent 5da7af1 commit ef7f819
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ public static class Styles
/// <summary>
/// FOV content
/// </summary>
public static readonly GUIContent fieldOfViewContent = EditorGUIUtility.TrTextContent("Field of View", "The height of the Cameras view angle, measured in degrees along the local Y axis.");
public static readonly GUIContent fieldOfViewContent = EditorGUIUtility.TrTextContent("Field of View", "The height of the Camera's view angle, measured in degrees along the specified axis.");

/// <summary>
/// FOV Axis content
/// </summary>
public static readonly GUIContent FOVAxisModeContent = EditorGUIUtility.TrTextContent("Field of View Axis", "Field of view axis.");
public static readonly GUIContent FOVAxisModeContent = EditorGUIUtility.TrTextContent("Field of View Axis", "The axis the Camera's view angle is measured along.");

/// <summary>
/// Physical camera content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class Styles
public static readonly GUIContent targetTextureLabel = EditorGUIUtility.TrTextContent("Output Texture", "The texture to render this camera into, if none then this camera renders to screen.");

public static string inspectorOverlayCameraText = L10n.Tr("Inspector Overlay Camera");
public static GUIContent allowMSAA = EditorGUIUtility.TrTextContent("MSAA", "Use Multi Sample Anti-Aliasing to reduce aliasing.");
public static GUIContent allowMSAA = EditorGUIUtility.TrTextContent("MSAA", "Enables Multi-Sample Anti-Aliasing, a technique that smooths jagged edges.");
public static GUIContent allowHDR = EditorGUIUtility.TrTextContent("HDR", "High Dynamic Range gives you a wider range of light intensities, so your lighting looks more realistic. With it, you can still see details and experience less saturation even with bright light.", (Texture)null);

public static string cameraTargetTextureMSAA = L10n.Tr("Camera target texture requires {0}x MSAA. Universal pipeline {1}.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ public partial class Rendering
{
public class Styles
{
public static GUIContent rendererType = EditorGUIUtility.TrTextContent("Renderer", "Controls which renderer this camera uses.");
public static GUIContent rendererType = EditorGUIUtility.TrTextContent("Renderer", "The series of operations that translates code into visuals. These have different capabilities and performance characteristics.");

public static GUIContent renderPostProcessing = EditorGUIUtility.TrTextContent("Post Processing", "Enable this to make this camera render post-processing effects.");
public static GUIContent antialiasing = EditorGUIUtility.TrTextContent("Anti-aliasing", "The anti-aliasing method to use.");
public static GUIContent antialiasing = EditorGUIUtility.TrTextContent("Anti-aliasing", "The method the camera uses to smooth jagged edges.");
public static GUIContent antialiasingQuality = EditorGUIUtility.TrTextContent("Quality", "The quality level to use for the selected anti-aliasing method.");

public static GUIContent requireDepthTexture = EditorGUIUtility.TrTextContent("Depth Texture", "On makes this camera create a _CameraDepthTexture, which is a copy of the rendered depth values.\nOff makes the camera not create a depth texture.\nUse Pipeline Settings applies settings from the Render Pipeline Asset.");
public static GUIContent requireOpaqueTexture = EditorGUIUtility.TrTextContent("Opaque Texture", "On makes this camera create a _CameraOpaqueTexture, which is a copy of the rendered view.\nOff makes the camera not create an opaque texture.\nUse Pipeline Settings applies settings from the Render Pipeline Asset.");
public static GUIContent requireDepthTexture = EditorGUIUtility.TrTextContent("Depth Texture", "If this is enabled, the camera builds a screen-space depth texture. Note that generating the texture incurs a performance cost.");
public static GUIContent requireOpaqueTexture = EditorGUIUtility.TrTextContent("Opaque Texture", "If this is enabled, the camera copies the rendered view so it can be accessed at a later stage in the pipeline.");

public static GUIContent clearDepth = EditorGUIUtility.TrTextContent("Clear Depth", "If enabled, depth from the previous camera will be cleared.");
public static GUIContent renderingShadows = EditorGUIUtility.TrTextContent("Render Shadows", "Makes this camera render shadows.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static class Styles
public static readonly GUIContent ShadowStrength = EditorGUIUtility.TrTextContent("Strength", "Controls how dark the shadows cast by the light will be.");
public static readonly GUIContent ShadowNearPlane = EditorGUIUtility.TrTextContent("Near Plane", "Controls the value for the near clip plane when rendering shadows. Currently clamped to 0.1 units or 1% of the lights range property, whichever is lower.");
public static readonly GUIContent ShadowNormalBias = EditorGUIUtility.TrTextContent("Normal", "Controls the distance shadow caster vertices are offset along their normals when rendering shadow maps. Currently ignored for Point Lights.");
public static readonly GUIContent ShadowDepthBias = EditorGUIUtility.TrTextContent("Depth");
public static readonly GUIContent ShadowDepthBias = EditorGUIUtility.TrTextContent("Depth", "Determines the distance at which Unity pushes shadows away from the shadow-casting GameObject along the line from the Light.");

// Resolution (default or custom)
public static readonly GUIContent ShadowResolution = EditorGUIUtility.TrTextContent("Resolution", $"Sets the rendered resolution of the shadow maps. A higher resolution increases the fidelity of shadows at the cost of GPU performance and memory usage. Rounded to the next power of two, and clamped to be at least {UniversalAdditionalLightData.AdditionalLightsShadowMinimumResolution}.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected class Styles

// Categories
public static readonly GUIContent SurfaceOptions =
EditorGUIUtility.TrTextContent("Surface Options", "Controls how Universal RP renders the Material on a screen.");
EditorGUIUtility.TrTextContent("Surface Options", "Controls how URP Renders the material on screen.");

public static readonly GUIContent SurfaceInputs = EditorGUIUtility.TrTextContent("Surface Inputs",
"These settings describe the look and feel of the surface itself.");
Expand Down Expand Up @@ -112,10 +112,10 @@ protected class Styles
"Specifies the base Material and/or Color of the surface. If you’ve selected Transparent or Alpha Clipping under Surface Options, your Material uses the Texture’s alpha channel or color.");

public static readonly GUIContent emissionMap = EditorGUIUtility.TrTextContent("Emission Map",
"Sets a Texture map to use for emission. You can also select a color with the color picker. Colors are multiplied over the Texture.");
"Determines the color and intensity of light that the surface of the material emits.");

public static readonly GUIContent normalMapText =
EditorGUIUtility.TrTextContent("Normal Map", "Assigns a tangent-space normal map.");
EditorGUIUtility.TrTextContent("Normal Map", "Designates a Normal Map to create the illusion of bumps and dents on this Material's surface.");

public static readonly GUIContent bumpScaleNotSupported =
EditorGUIUtility.TrTextContent("Bump scale is not supported on mobile platforms");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,44 +21,48 @@ public enum ColorMode

public static class Styles
{
public static GUIContent colorMode = new GUIContent("Color Mode",
public static GUIContent colorMode = EditorGUIUtility.TrTextContent("Color Mode",
"Controls how the Particle color and the Material color blend together.");

public static GUIContent flipbookMode = new GUIContent("Flip-Book Blending",
public static GUIContent flipbookMode = EditorGUIUtility.TrTextContent("Flip-Book Blending",
"Blends the frames in a flip-book together in a smooth animation.");

public static GUIContent softParticlesEnabled = new GUIContent("Soft Particles",
public static GUIContent softParticlesEnabled = EditorGUIUtility.TrTextContent("Soft Particles",
"Makes particles fade out when they get close to intersecting with the surface of other geometry in the depth buffer.");

public static GUIContent softParticlesFadeText = EditorGUIUtility.TrTextContent("Surface Fade");

public static GUIContent softParticlesNearFadeDistanceText =
new GUIContent("Near",
EditorGUIUtility.TrTextContent("Near",
"The distance from the other surface where the particle is completely transparent.");

public static GUIContent softParticlesFarFadeDistanceText =
new GUIContent("Far",
EditorGUIUtility.TrTextContent("Far",
"The distance from the other surface where the particle is completely opaque.");

public static GUIContent cameraFadingEnabled = new GUIContent("Camera Fading",
public static GUIContent cameraFadingEnabled = EditorGUIUtility.TrTextContent("Camera Fading",
"Makes particles fade out when they get close to the camera.");

public static GUIContent cameraFadingDistanceText = EditorGUIUtility.TrTextContent("Distance");

public static GUIContent cameraNearFadeDistanceText =
new GUIContent("Near",
EditorGUIUtility.TrTextContent("Near",
"The distance from the camera where the particle is completely transparent.");

public static GUIContent cameraFarFadeDistanceText =
new GUIContent("Far", "The distance from the camera where the particle is completely opaque.");
EditorGUIUtility.TrTextContent("Far", "The distance from the camera where the particle is completely opaque.");

public static GUIContent distortionEnabled = new GUIContent("Distortion",
public static GUIContent distortionEnabled = EditorGUIUtility.TrTextContent("Distortion",
"Creates a distortion effect by making particles perform refraction with the objects drawn before them.");

public static GUIContent distortionStrength = new GUIContent("Strength",
public static GUIContent distortionStrength = EditorGUIUtility.TrTextContent("Strength",
"Controls how much the Particle distorts the background. ");

public static GUIContent distortionBlend = new GUIContent("Blend",
public static GUIContent distortionBlend = EditorGUIUtility.TrTextContent("Blend",
"Controls how visible the distortion effect is. At 0, there’s no visible distortion. At 1, only the distortion effect is visible, not the background.");

public static GUIContent VertexStreams = new GUIContent("Vertex Streams",
"The vertex streams needed for this Material to function properly.");
public static GUIContent VertexStreams = EditorGUIUtility.TrTextContent("Vertex Streams",
"List detailing the expected layout of data sent to the shader from the particle system.");

public static string streamPositionText = "Position (POSITION.xyz)";
public static string streamNormalText = "Normal (NORMAL.xyz)";
Expand All @@ -70,7 +74,7 @@ public static class Styles
public static string streamAnimFrameText = "AnimFrame (INSTANCED1.x)";
public static string streamTangentText = "Tangent (TANGENT.xyzw)";

public static GUIContent streamApplyToAllSystemsText = new GUIContent("Fix Now",
public static GUIContent streamApplyToAllSystemsText = EditorGUIUtility.TrTextContent("Fix Now",
"Apply the vertex stream layout to all Particle Systems using this material");

public static string undoApplyCustomVertexStreams = L10n.Tr("Apply custom vertex streams from material");
Expand Down Expand Up @@ -178,7 +182,7 @@ public static void FadingOptions(Material material, MaterialEditor materialEdito
}

EditorGUI.indentLevel++;
BaseShaderGUI.TwoFloatSingleLine(new GUIContent("Surface Fade"),
BaseShaderGUI.TwoFloatSingleLine(Styles.softParticlesFadeText,
properties.softParticlesNearFadeDistance,
Styles.softParticlesNearFadeDistanceText,
properties.softParticlesFarFadeDistance,
Expand All @@ -194,7 +198,7 @@ public static void FadingOptions(Material material, MaterialEditor materialEdito
if (properties.cameraFadingEnabled.floatValue >= 0.5f)
{
EditorGUI.indentLevel++;
BaseShaderGUI.TwoFloatSingleLine(new GUIContent("Distance"),
BaseShaderGUI.TwoFloatSingleLine(Styles.cameraFadingDistanceText,
properties.cameraNearFadeDistance,
Styles.cameraNearFadeDistanceText,
properties.cameraFarFadeDistance,
Expand Down Expand Up @@ -278,7 +282,7 @@ public static void DoVertexStreamsArea(Material material, List<ParticleSystemRen
vertexStreamList = new ReorderableList(streamList, typeof(string), false, true, false, false);

vertexStreamList.drawHeaderCallback = (Rect rect) => {
EditorGUI.LabelField(rect, "Vertex Streams");
EditorGUI.LabelField(rect, Styles.VertexStreams);
};

vertexStreamList.DoLayoutList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ internal class LitDetailGUI
{
public static class Styles
{
public static readonly GUIContent detailInputs = new GUIContent("Detail Inputs",
"These settings let you add details to the surface.");
public static readonly GUIContent detailInputs = EditorGUIUtility.TrTextContent("Detail Inputs",
"These settings define the surface details by tiling and overlaying additional maps on the surface.");

public static readonly GUIContent detailMaskText = new GUIContent("Mask",
"Select a mask for the Detail maps. The mask uses the alpha channel of the selected texture. The __Tiling__ and __Offset__ settings have no effect on the mask.");
public static readonly GUIContent detailMaskText = EditorGUIUtility.TrTextContent("Mask",
"Select a mask for the Detail map. The mask uses the alpha channel of the selected texture. The Tiling and Offset settings have no effect on the mask.");

public static readonly GUIContent detailAlbedoMapText = new GUIContent("Base Map",
"Select the texture containing the surface details.");
public static readonly GUIContent detailAlbedoMapText = EditorGUIUtility.TrTextContent("Base Map",
"Select the surface detail texture.The alpha of your texture determines surface hue and intensity.");

public static readonly GUIContent detailNormalMapText = new GUIContent("Normal Map",
"Select the texture containing the normal vector data.");
public static readonly GUIContent detailNormalMapText = EditorGUIUtility.TrTextContent("Normal Map",
"Designates a Normal Map to create the illusion of bumps and dents in the details of this Material's surface.");

public static readonly GUIContent detailAlbedoMapScaleInfo = new GUIContent("Setting the scaling factor to a value other than 1 results in a less performant shader variant.");
public static readonly GUIContent detailAlbedoMapScaleInfo = EditorGUIUtility.TrTextContent("Setting the scaling factor to a value other than 1 results in a less performant shader variant.");
}

public struct LitProperties
Expand Down
Loading

0 comments on commit ef7f819

Please sign in to comment.