publicbooluseForwardRenderingOnly=false;// TODO: Currently there is no way to strip the extra forward shaders generated by the shaders compiler, so we can switch dynamically.
publicbooluseForwardRenderingOnly;// TODO: Currently there is no way to strip the extra forward shaders generated by the shaders compiler, so we can switch dynamically.
publicbooluseDepthPrepassWithDeferredRendering;
publicboolrenderAlphaTestOnlyInDeferredPrepass;
// We have to fall back to forward-only rendering when scene view is using wireframe rendering mode --
// as rendering everything in wireframe + deferred do not play well together
// These need to be Runtime Only because those values are hold by the HDRenderPipeline asset so if user change them through the editor debug menu they might change the value in the asset without noticing it.
DebugMenuManager.instance.AddDebugItem<bool>("HDRP","Enable Big Tile",()=>(bool)m_Asset.tileSettings.enableBigTilePrepass,(value)=>m_Asset.tileSettings.enableBigTilePrepass=(bool)value,DebugItemFlag.RuntimeOnly);
DebugMenuManager.instance.AddDebugItem<bool>("HDRP","Enable Material Classification",()=>(bool)m_Asset.tileSettings.enableComputeMaterialVariants,(value)=>m_Asset.tileSettings.enableComputeMaterialVariants=(bool)value,DebugItemFlag.RuntimeOnly);
DebugMenuManager.instance.AddDebugItem<bool>("HDRP","Enable Big Tile",()=>m_Asset.tileSettings.enableBigTilePrepass,(value)=>m_Asset.tileSettings.enableBigTilePrepass=(bool)value,DebugItemFlag.RuntimeOnly);
DebugMenuManager.instance.AddDebugItem<bool>("HDRP","Enable Material Classification",()=>m_Asset.tileSettings.enableComputeMaterialVariants,(value)=>m_Asset.tileSettings.enableComputeMaterialVariants=(bool)value,DebugItemFlag.RuntimeOnly);
m_CameraStencilBufferCopy=newRenderTexture(camera.pixelWidth,camera.pixelHeight,0,RenderTextureFormat.R8,RenderTextureReadWrite.Linear);// DXGI_FORMAT_R8_UINT is not supported by Unity
// We use 8x8 tiles in order to match the native GCN HTile as closely as possible.
m_HTile=newRenderTexture((camera.pixelWidth+7)/8,(camera.pixelHeight+7)/8,0,RenderTextureFormat.R8,RenderTextureReadWrite.Linear);// DXGI_FORMAT_R8_UINT is not supported by Unity
// TEMP: As we are in development and have not all the setup pass we still clear the color in emissive buffer and gbuffer, but this will be removed later.
publicstaticGUIContentmaterialIDText=newGUIContent("Material type","Subsurface Scattering: enable for translucent materials such as skin, vegetation, fruit, marble, wax and milk.");
// Displacement mapping (POM, tessellation, per vertex)
publicstaticGUIContentlockWithObjectScaleText=newGUIContent("Lock with object scale","Displacement mapping will take the absolute value of the scale of the object into account.");
publicstaticGUIContentlockWithObjectScaleText=newGUIContent("Lock with object scale","Displacement mapping will take the absolute value of the scale of the object into account.");
publicstaticGUIContentlockWithTilingRateText=newGUIContent("Lock with height map tiling rate","Displacement mapping will take the absolute value of the tiling rate of the height map into account.");
// Per pixel displacement
publicstaticGUIContentppdLodThresholdText=newGUIContent("Fading mip level start","Starting heightmap mipmap lod number where the parallax occlusion mapping effect start to disappear");
publicstaticGUIContentperPixelDisplacementObjectScaleText=newGUIContent("Lock with object scale","Per Pixel displacement will take into account the tiling scale - Only work with uniform positive scale");
publicstaticGUIContentppdPrimitiveLength=newGUIContent("Primitive length","Dimensions of the primitive (with the scale of 1) to which the per-pixel displacement mapping is being applied. For example, the standard quad is 1 x 1 meter, while the standard plane is 10 x 10 meters.");
publicstaticGUIContentppdPrimitiveWidth=newGUIContent("Primitive width","Dimensions of the primitive (with the scale of 1) to which the per-pixel displacement mapping is being applied. For example, the standard quad is 1 x 1 meter, while the standard plane is 10 x 10 meters.");
publicreadonlyGUIContentsssTransmittancePreview1=newGUIContent("Shows the fraction of light passing through the object for thickness values from the remap.");
publicreadonlyGUIContentsssTransmittancePreview2=newGUIContent("Can be viewed as a cross section of a slab of material illuminated by white light from the left.");
publicreadonlyGUIContentsssProfileScatteringDistance=newGUIContent("Scattering Distance","Determines the shape of the profile, and the blur radius of the filter per color channel. Alpha is ignored.");
publicreadonlyGUIContentsssProfileTransmissionTint=newGUIContent("Transmission tint","Color which tints transmitted light. Alpha is ignored.");
publicreadonlyGUIContentsssProfileMaxRadius=newGUIContent("Max Radius","Effective radius of the filter (in millimeters). The blur is energy-preserving, so a wide filter results in a large area with small contributions of individual samples. Reducing the distance increases the sharpness of the result.");
publicreadonlyGUIContentsssTexturingMode=newGUIContent("Texturing Mode","Specifies when the diffuse texture should be applied.");
newGUIContent("Pre- and post-scatter","Texturing is performed during both the lighting and the SSS passes. Slightly blurs the diffuse texture. Choose this mode if your diffuse texture contains little to no SSS lighting."),
newGUIContent("Post-scatter","Texturing is performed only during the SSS pass. Effectively preserves the sharpness of the diffuse texture. Choose this mode if your diffuse texture already contains SSS lighting (e.g. a photo of skin).")
};
publicreadonlyGUIContentsssProfileTransmissionMode=newGUIContent("Transmission Mode","Configures the simulation of light passing through thin objects. Depends on the thickness value (which is applied in the normal direction).");
newGUIContent("None","Disables transmission. Choose this mode for completely opaque, or very thick translucent objects."),
newGUIContent("Thin Object","Choose this mode for thin objects, such as paper or leaves. Transmitted light reuses the shadowing state of the surface."),
newGUIContent("Regular","Choose this mode for moderately thick objects. For performance reasons, transmitted light ignores occlusion (shadows).")
};
publicreadonlyGUIContentsssProfileMinMaxThickness=newGUIContent("Min-Max Thickness","Shows the values of the thickness remap below (in millimeters).");
publicreadonlyGUIContentsssProfileThicknessRemap=newGUIContent("Thickness Remap","Remaps the thickness parameter from [0, 1] to the desired range (in millimeters).");
publicreadonlyGUIContentsssProfileWorldScale=newGUIContent("World Scale","Size of the world unit in meters.");
// Old SSS Model >>>
publicreadonlyGUIContentsssProfileScatterDistance1=newGUIContent("Scattering Distance #1","The radius (in centimeters) of the 1st Gaussian filter, one per color channel. Alpha is ignored. The blur is energy-preserving, so a wide filter results in a large area with small contributions of individual samples. Smaller values increase the sharpness.");
publicreadonlyGUIContentsssProfileScatterDistance2=newGUIContent("Scattering Distance #2","The radius (in centimeters) of the 2nd Gaussian filter, one per color channel. Alpha is ignored. The blur is energy-preserving, so a wide filter results in a large area with small contributions of individual samples. Smaller values increase the sharpness.");
publicreadonlyGUIContentsssProfileLerpWeight=newGUIContent("Filter Interpolation","Controls linear interpolation between the two Gaussian filters.");
Matrix4x4worldToView=lookAt*Matrix4x4.Scale(newVector3(1.0f,1.0f,-1.0f));// Need to scale -1.0 on Z to match what is being done in the camera.wolrdToCameraMatrix API. ...
varworldToView=lookAt*Matrix4x4.Scale(newVector3(1.0f,1.0f,-1.0f));// Need to scale -1.0 on Z to match what is being done in the camera.wolrdToCameraMatrix API. ...
// A Material can be authored from the shader graph or by hand. When written by hand we need to provide an inspector.
// Such a Material will share some properties between it various variant (shader graph variant or hand authored variant).
// This is the purpose of BaseLitGUI. It contain all properties that are common to all Material based on Lit template.
// For the default hand written Lit material see LitUI.cs that contain specific properties for our default implementation.
public abstract class BaseLitGUI : BaseUnlitGUI
{
protected static class StylesBaseLit
{
public static GUIContent doubleSidedNormalModeText = new GUIContent("Normal mode", "This will modify the normal base on the selected mode. None: untouch, Mirror: Mirror the normal with vertex normal plane, Flip: Flip the normal");
public static GUIContent depthOffsetEnableText = new GUIContent("Enable Depth Offset", "EnableDepthOffset on this shader (Use with heightmap)");
// Material ID
public static GUIContent materialIDText = new GUIContent("Material type", "Subsurface Scattering: enable for translucent materials such as skin, vegetation, fruit, marble, wax and milk.");
// Displacement mapping (POM, tessellation, per vertex)
public static GUIContent lockWithObjectScaleText = new GUIContent("Lock with object scale", "Displacement mapping will take the absolute value of the scale of the object into account.");
public static GUIContent lockWithTilingRateText = new GUIContent("Lock with height map tiling rate", "Displacement mapping will take the absolute value of the tiling rate of the height map into account.");
// Per pixel displacement
public static GUIContent enablePerPixelDisplacementText = new GUIContent("Enable Per Pixel Displacement", "Per pixel displacement work best with flat surfaces. This is an expensive features and should be enable wisely. Typical use case is paved road.");
public static GUIContent ppdMinSamplesText = new GUIContent("Minimum steps", "Minimum steps (texture sample) to use with per pixel displacement mapping");
public static GUIContent ppdMaxSamplesText = new GUIContent("Maximum steps", "Maximum steps (texture sample) to use with per pixel displacement mapping");
public static GUIContent ppdLodThresholdText = new GUIContent("Fading mip level start", "Starting heightmap mipmap lod number where the parallax occlusion mapping effect start to disappear");
<<<<<<< HEAD
public static GUIContent ppdPrimitiveLength = new GUIContent("Primitive length", "Dimensions of the primitive (with the scale of 1) to which the per-pixel displacement mapping is being applied. For example, the standard quad is 1 x 1 meter, while the standard plane is 10 x 10 meters.");
public static GUIContent ppdPrimitiveWidth = new GUIContent("Primitive width", "Dimensions of the primitive (with the scale of 1) to which the per-pixel displacement mapping is being applied. For example, the standard quad is 1 x 1 meter, while the standard plane is 10 x 10 meters.");
=======
public static GUIContent perPixelDisplacementObjectScaleText = new GUIContent("Lock with object scale", "Per Pixel displacement will take into account the tiling scale - Only work with uniform positive scale");
>>>>>>> Unity-2017.3
// Vertex displacement
public static string vertexDisplacementText = "Vertex displacement";
public static GUIContent enableVertexDisplacementText = new GUIContent("Enable vertex displacement", "Use heightmap as a displacement map. Displacement map is use to move vertex position in local space");
// Tessellation
public static string tessellationModeText = "Tessellation Mode";
public static readonly string[] tessellationModeNames = Enum.GetNames(typeof(TessellationMode));
public static GUIContent tessellationText = new GUIContent("Tessellation options", "Tessellation options");
public static GUIContent tessellationFactorText = new GUIContent("Tessellation factor", "This value is the tessellation factor use for tessellation, higher mean more tessellated");
public static GUIContent tessellationFactorMinDistanceText = new GUIContent("Start fade distance", "Distance (in unity unit) at which the tessellation start to fade out. Must be inferior at Max distance");
public static GUIContent tessellationFactorMaxDistanceText = new GUIContent("End fade distance", "Maximum distance (in unity unit) to the camera where triangle are tessellated");
public static GUIContent tessellationFactorTriangleSizeText = new GUIContent("Triangle size", "Desired screen space sized of triangle (in pixel). Smaller value mean smaller triangle.");
public static GUIContent tessellationShapeFactorText = new GUIContent("Shape factor", "Strength of Phong tessellation shape (lerp factor)");
public static GUIContent tessellationBackFaceCullEpsilonText = new GUIContent("Triangle culling Epsilon", "If -1.0 back face culling is enabled for tessellation, higher number mean more aggressive culling and better performance");
// Vertex animation
public static string vertexAnimation = "Vertex animation";
// Wind
public static GUIContent windText = new GUIContent("Enable Wind");
public static GUIContent windInitialBendText = new GUIContent("Initial Bend");
public static GUIContent windStiffnessText = new GUIContent("Stiffness");
public static GUIContent windDragText = new GUIContent("Drag");
public static GUIContent windShiverDragText = new GUIContent("Shiver Drag");
public static GUIContent windShiverDirectionalityText = new GUIContent("Shiver Directionality");
publicreadonlyGUIContenttransmittancePreview1=newGUIContent("Shows the fraction of light passing through the object for thickness values from the remap.");
publicreadonlyGUIContenttransmittancePreview2=newGUIContent("Can be viewed as a cross section of a slab of material illuminated by white light from the left.");
publicreadonlyGUIContentprofileScatteringDistance=newGUIContent("Scattering Distance","Determines the shape of the profile, and the blur radius of the filter per color channel. Alpha is ignored.");
publicreadonlyGUIContentprofileTransmissionTint=newGUIContent("Transmission tint","Color which tints transmitted light. Alpha is ignored.");
publicreadonlyGUIContentprofileMaxRadius=newGUIContent("Max Radius","Effective radius of the filter (in millimeters). The blur is energy-preserving, so a wide filter results in a large area with small contributions of individual samples. Reducing the distance increases the sharpness of the result.");
publicreadonlyGUIContenttexturingMode=newGUIContent("Texturing Mode","Specifies when the diffuse texture should be applied.");
newGUIContent("Pre- and post-scatter","Texturing is performed during both the lighting and the SSS passes. Slightly blurs the diffuse texture. Choose this mode if your diffuse texture contains little to no SSS lighting."),
newGUIContent("Post-scatter","Texturing is performed only during the SSS pass. Effectively preserves the sharpness of the diffuse texture. Choose this mode if your diffuse texture already contains SSS lighting (e.g. a photo of skin).")
};
publicreadonlyGUIContentprofileTransmissionMode=newGUIContent("Transmission Mode","Configures the simulation of light passing through thin objects. Depends on the thickness value (which is applied in the normal direction).");
newGUIContent("None","Disables transmission. Choose this mode for completely opaque, or very thick translucent objects."),
newGUIContent("Thin Object","Choose this mode for thin objects, such as paper or leaves. Transmitted light reuses the shadowing state of the surface."),
newGUIContent("Regular","Choose this mode for moderately thick objects. For performance reasons, transmitted light ignores occlusion (shadows).")
};
publicreadonlyGUIContentprofileMinMaxThickness=newGUIContent("Min-Max Thickness","Shows the values of the thickness remap below (in millimeters).");
publicreadonlyGUIContentprofileThicknessRemap=newGUIContent("Thickness Remap","Remaps the thickness parameter from [0, 1] to the desired range (in millimeters).");
publicreadonlyGUIContentprofileWorldScale=newGUIContent("World Scale","Size of the world unit in meters.");
// Old SSS Model >>>
publicreadonlyGUIContentprofileScatterDistance1=newGUIContent("Scattering Distance #1","The radius (in centimeters) of the 1st Gaussian filter, one per color channel. Alpha is ignored. The blur is energy-preserving, so a wide filter results in a large area with small contributions of individual samples. Smaller values increase the sharpness.");
publicreadonlyGUIContentprofileScatterDistance2=newGUIContent("Scattering Distance #2","The radius (in centimeters) of the 2nd Gaussian filter, one per color channel. Alpha is ignored. The blur is energy-preserving, so a wide filter results in a large area with small contributions of individual samples. Smaller values increase the sharpness.");
publicreadonlyGUIContentprofileLerpWeight=newGUIContent("Filter Interpolation","Controls linear interpolation between the two Gaussian filters.");