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.");
publicstaticGUIContentenableMotionVectorForVertexAnimationText=newGUIContent("Enable MotionVector For Vertex Animation","This will enable an object motion vector pass for this material. Useful if wind animation is enabled or if displacement map is animated");
// Material ID
publicstaticGUIContentmaterialIDText=newGUIContent("Material type","Subsurface Scattering: enable for translucent materials such as skin, vegetation, fruit, marble, wax and milk.");
// If opaque velocity have been render during GBuffer no need to render it here
// TODO: Currently we can't render velocity vector into GBuffer, neither during forward pass (in case of forward opaque), so it is always a separate pass
// Note that we if we have forward only opaque with deferred rendering, it must also support the rendering of velocity vector to be correct with following test.
if((ShaderConfig.s_VelocityInGbuffer==1))
{
Debug.LogWarning("Velocity in Gbuffer is currently not supported");
// TODO: It is not possible to use VelocityInGBuffer feature yet. This feature allow to render motion vectors during Gbuffer pass. However Unity have limitation today that forbid to do that.
// 1) Currently previousPositionCS is provide to the vertex shader with a hard coded NORMAL semantic (in the vertex declaration - See MeshRenderingData.cpp "pSecondaryFormat = gMotionVectorRenderFormat.GetVertexFormat();") mean it will overwrite the normal
// 2) All current available semantic (see ShaderChannelMask) are used in our Lit shader. Mean just changing the semantic is not enough, Unity need to unlock other Texcoord semantic
// 3) When this is solve (i.e move previousPositionCS to a free attribute semantic), Unity only support one pSecondaryFormat. Mean if we ahve a vertex color instance stream and motion vector, motion vector will overwrite vertex color stream. See MeshRenderingData.cpp
// All this could be fix we a new Mesh API not ready yet. Note that this feature only affect animated mesh (vertex or skin) as others use depth reprojection.
VelocityInGBuffer=0,// Change to 1 to enable the feature, then regenerate hlsl headers.
CameraRelativeRendering=1// Rendering sets the origin of the world to the position of the primary (scene view) camera
};
{
// const variable produce warning like this one: warning CS0162: Unreachable code detected
// If we want to avoid them we can add #pragma warning disable 162, however doing that make the debugger shift his line count when debugging which is really annoying
// so here we decalare two kind of variable, one const that can be use in enum init and one static so the compiler doesn't complain. It mean that the conditional code will stay
// but it is usually small, so we are fine with it (until someone at microsoft fix the debuggger).