Skip to content

Commit

Permalink
Added unit test showing clearly results with UV1
Browse files Browse the repository at this point in the history
  • Loading branch information
JGamache-autodesk committed Aug 28, 2023
1 parent 5c162e1 commit e660d19
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
137 changes: 137 additions & 0 deletions test/testSamples/MaterialX/DemoQuads.usda
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,88 @@ def Mesh "pPlane6" (
uniform token[] xformOpOrder = ["xformOp:translate"]
}

def Mesh "pMultiUVPlane3" (
prepend apiSchemas = ["MaterialBindingAPI"]
kind = "component"
)
{
uniform bool doubleSided = 1
float3[] extent = [(-0.5, 0, -0.5), (0.5, 0, 0.5)]
int[] faceVertexCounts = [4]
int[] faceVertexIndices = [0, 1, 3, 2]
rel material:binding = </mtl/standard_surfaceUV1_3>
point3f[] points = [(-0.5, 0, 0.5), (0.5, 0, 0.5), (-0.5, 0, -0.5), (0.5, 0, -0.5)]
color3f[] primvars:displayColor = [(0.13320851, 0.13320851, 0.13320851)] (
customData = {
dictionary Maya = {
bool generated = 1
}
}
)
texCoord2f[] primvars:st = [(0, 0), (1, 0), (0, 1), (1, 1)] (
customData = {
dictionary Maya = {
token name = "map1"
}
}
interpolation = "faceVarying"
)
texCoord2f[] primvars:st1 = [(0.50056624, -0.00038683414), (1.0003868, 0.50056624), (-0.00038683414, 0.49943376), (0.49943376, 1.0003868)] (
customData = {
dictionary Maya = {
token name = "uvSet1"
}
}
interpolation = "faceVarying"
)
int[] primvars:st1:indices = [0, 1, 3, 2]
int[] primvars:st:indices = [0, 1, 3, 2]
token visibility = "inherited"
double3 xformOp:translate = (-1.1, 0, 1.1)
uniform token[] xformOpOrder = ["xformOp:translate"]
}

def Mesh "pMultiUVPlane4" (
prepend apiSchemas = ["MaterialBindingAPI"]
kind = "component"
)
{
uniform bool doubleSided = 1
float3[] extent = [(-0.5, 0, -0.5), (0.5, 0, 0.5)]
int[] faceVertexCounts = [4]
int[] faceVertexIndices = [0, 1, 3, 2]
rel material:binding = </mtl/standard_surfaceUV1_4>
point3f[] points = [(-0.5, 0, 0.5), (0.5, 0, 0.5), (-0.5, 0, -0.5), (0.5, 0, -0.5)]
color3f[] primvars:displayColor = [(0.13320851, 0.13320851, 0.13320851)] (
customData = {
dictionary Maya = {
bool generated = 1
}
}
)
texCoord2f[] primvars:st = [(0, 0), (1, 0), (0, 1), (1, 1)] (
customData = {
dictionary Maya = {
token name = "map1"
}
}
interpolation = "faceVarying"
)
texCoord2f[] primvars:st1 = [(0.50056624, -0.00038683414), (1.0003868, 0.50056624), (-0.00038683414, 0.49943376), (0.49943376, 1.0003868)] (
customData = {
dictionary Maya = {
token name = "uvSet1"
}
}
interpolation = "faceVarying"
)
int[] primvars:st1:indices = [0, 1, 3, 2]
int[] primvars:st:indices = [0, 1, 3, 2]
token visibility = "inherited"
double3 xformOp:translate = (0, 0, 1.1)
uniform token[] xformOpOrder = ["xformOp:translate"]
}

def Scope "mtl"
{
def Material "imageR8U"
Expand Down Expand Up @@ -443,6 +525,61 @@ def Scope "mtl"
uniform float2 ui:nodegraph:node:pos = (-2.538889, 0.92777777)
}
}
def Material "standard_surfaceUV1_3"
{
token outputs:mtlx:surface.connect = </mtl/standard_surfaceUV1_3/standard_surfaceUV1_1.outputs:out>

def Shader "standard_surfaceUV1_1"
{
uniform token info:id = "ND_standard_surface_surfaceshader"
color3f inputs:base_color.connect = </mtl/standard_surfaceUV1_3/image1.outputs:out>
token outputs:out
}

def Shader "image1"
{
uniform token info:id = "ND_image_color3"
asset inputs:file = @textures/grid.png@
string inputs:filtertype = "closest"
float2 inputs:texcoord.connect = </mtl/standard_surfaceUV1_3/geompropvalue1.outputs:out>
color3f outputs:out
}

def Shader "geompropvalue1"
{
uniform token info:id = "ND_geompropvalue_vector2"
string inputs:geomprop = "st1"
float2 outputs:out
}
}

def Material "standard_surfaceUV1_4"
{
token outputs:mtlx:surface.connect = </mtl/standard_surfaceUV1_4/standard_surfaceUV1_1.outputs:out>

def Shader "standard_surfaceUV1_1"
{
uniform token info:id = "ND_standard_surface_surfaceshader"
color3f inputs:base_color.connect = </mtl/standard_surfaceUV1_4/image1.outputs:out>
token outputs:out
}

def Shader "image1"
{
uniform token info:id = "ND_image_color3"
asset inputs:file = @textures/grid.png@
string inputs:filtertype = "closest"
float2 inputs:texcoord.connect = </mtl/standard_surfaceUV1_4/texcoord1.outputs:out>
color3f outputs:out
}

def Shader "texcoord1"
{
uniform token info:id = "ND_texcoord_vector2"
int inputs:index = 1
float2 outputs:out
}
}
}

def Mesh "Background" (
Expand Down
14 changes: 11 additions & 3 deletions test/testSamples/MaterialX/MtlxUVStreamTest.usda
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,19 @@ def Mesh "pCube1" (
def Shader "noise1"
{
uniform token info:id = "ND_noise2d_float"
float inputs:amplitude = 0.5
float2 inputs:texcoord.connect = </pCube1/Looks/standardSurface2SG/MayaNG_standardSurface2SG/UV1.outputs:out>
float inputs:amplitude = 0.6
float2 inputs:texcoord.connect = </pCube1/Looks/standardSurface2SG/MayaNG_standardSurface2SG/multiply10.outputs:out>
float outputs:out
}


def Shader "multiply10"
{
uniform token info:id = "ND_multiply_vector2FA"
float inputs:in1.connect = </pCube1/Looks/standardSurface2SG/MayaNG_standardSurface2SG/UV1.outputs:out>
float inputs:in2 = 10.0
float outputs:out
}

def Shader "UV1"
{
uniform token info:id = "ND_texcoord_vector2"
Expand Down

0 comments on commit e660d19

Please sign in to comment.