Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lanierd-adsk committed Dec 10, 2024
1 parent 03c507d commit 1156afb
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
31 changes: 31 additions & 0 deletions lib/flowViewport/usdPlugins/shadersDiscoveryPlugin/README
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,34 @@ The shaders defined in shadersDef.usda will be loaded by usd/hydra and available

You can add the plugInfo.json file path in the environment variable PXR_PLUGINPATH_NAME or use another .json file to load it
so USD/Hydra loads it at startup.

To use the FVP_CustomBasicLightingShader GLSLFX shader into a usd file, just add this definition to your file :

def Scope "mtl"
{
def Material "CustomGLSL"
{
token outputs:surface.connect = </mtl/CustomGLSL/CustomGLSLShader1.outputs:surface>

def Shader "CustomGLSLShader1"
{
uniform token info:id = "FVP_CustomBasicLightingShader"
token outputs:surface
}
}
}

You can also assign the material binding to a prim directly by adding :

def Mesh "Mesh1" (
prepend apiSchemas = ["MaterialBindingAPI"]
)
{
uniform bool doubleSided = 1
float3[] extent = [(-1.0000002, -1, -1.0000005), (1, 1, 1.0000001)]
int[] faceVertexCounts = ...
int[] faceVertexIndices = ...
rel material:binding = </mtl/CustomGLSL>
point3f[] points = ...
...
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,37 @@
//
// createNode("MhCustomShaders")
//
// To use the custom shader into a usd file, please add to your file :
/*
def Scope "mtl"
{
def Material "CustomGLSL"
{
token outputs:surface.connect = </mtl/CustomGLSL/CustomGLSLShader1.outputs:surface>
def Shader "CustomGLSLShader1"
{
uniform token info:id = "FVP_CustomBasicLightingShader"
token outputs:surface
}
}
}
You can also assign the material binding to a prim directly by adding :
def Mesh "Mesh1" (
prepend apiSchemas = ["MaterialBindingAPI"]
)
{
uniform bool doubleSided = 1
float3[] extent = [(-1.0000002, -1, -1.0000005), (1, 1, 1.0000001)]
int[] faceVertexCounts = ...
int[] faceVertexIndices = ...
rel material:binding = </mtl/CustomGLSL>
point3f[] points = ...
...
}
*/
////////////////////////////////////////////////////////////////////////

//maya headers
Expand Down

0 comments on commit 1156afb

Please sign in to comment.