-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MAYA-109893 Integrate 21.05 UsdPreviewSurface shader into mayaUsd plugin #1416
Merged
kxl-adsk
merged 6 commits into
dev
from
t_gamaj/MAYA-109893/use_external_light_functions
May 20, 2021
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ffd49a9
MAYA-109893 Integrate 21.05 UsdPreviewSurface shader into mayaUsd plugin
JGamache-autodesk ad3dd7e
Add checks for NG lighting availability.
JGamache-autodesk ac40acb
Merge remote-tracking branch 'github/dev' into t_gamaj/MAYA-109893/us…
JGamache-autodesk e295f12
Improve detection of LightAPI2
JGamache-autodesk 8abf3b1
Fix library discovery on Mac/Linux
JGamache-autodesk c98719c
Fix typo.
JGamache-autodesk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
lib/mayaUsd/render/vp2ShaderFragments/UsdPreviewSurfaceLightAPI2.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<!-- | ||
======================================================================== | ||
Copyright 2018 Pixar | ||
Copyright 2020 Autodesk | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
======================================================================== | ||
--> | ||
<fragment_graph name="UsdPreviewSurface" ref="UsdPreviewSurface" class="FragmentGraph" version="1.0" feature_level="0"> | ||
<fragments> | ||
<!-- Fragments for extracting computed dot products. --> | ||
<fragment_ref name="NwFaceCameraIfNAN" ref="NwFaceCameraIfNAN"/> | ||
|
||
<!-- Fragments for computing material. --> | ||
<fragment_ref name="opacityToTransparency" ref="opacityToTransparency"/> | ||
<fragment_ref name="usdPreviewSurfaceLightingAPI2" ref="usdPreviewSurfaceLightingAPI2"/> | ||
|
||
<!-- Maya fragments for computing the output surface values. --> | ||
<fragment_ref name="maya_FogDepthSurface" ref="maya_FogDepthSurface"/> | ||
<fragment_ref name="mayaComputeSurfaceFinal" ref="mayaComputeSurfaceFinal"/> | ||
<fragment_ref name="mayaSurfaceShaderOutput" ref="mayaSurfaceShaderOutput"/> | ||
</fragments> | ||
<connections> | ||
<connect from="NwFaceCameraIfNAN.output" to="usdPreviewSurfaceLightingAPI2.Nw" name="Nw"/> | ||
<connect from="opacityToTransparency.transparency" to="usdPreviewSurfaceLightingAPI2.transparency" name="transparency"/> | ||
<connect from="usdPreviewSurfaceLightingAPI2.surfaceShader" to="mayaComputeSurfaceFinal.input" name="input"/> | ||
<connect from="maya_FogDepthSurface.maya_FogDepthSurface" to="mayaComputeSurfaceFinal.maya_FogDepthSurface" name="maya_FogDepthSurface"/> | ||
<connect from="mayaComputeSurfaceFinal.mayaComputeSurfaceFinal" to="mayaSurfaceShaderOutput.mayaSurfaceShaderOutput" name="mayaSurfaceShaderOutput"/> | ||
</connections> | ||
<properties> | ||
<!-- UsdPreviewSurface Parameters --> | ||
<float name="clearcoat" ref="usdPreviewSurfaceLightingAPI2.clearcoatAmount"/> | ||
<float name="clearcoatRoughness" ref="usdPreviewSurfaceLightingAPI2.clearcoatRoughness"/> | ||
<float3 name="diffuseColor" ref="usdPreviewSurfaceLightingAPI2.diffuseColor" flags="multiDraw"/> | ||
<float3 name="emissiveColor" ref="usdPreviewSurfaceLightingAPI2.emissiveColor"/> | ||
<float name="ior" ref="usdPreviewSurfaceLightingAPI2.ior"/> | ||
<float name="metallic" ref="usdPreviewSurfaceLightingAPI2.metallic"/> | ||
<float name="occlusion" ref="usdPreviewSurfaceLightingAPI2.occlusion"/> | ||
<float name="roughness" ref="usdPreviewSurfaceLightingAPI2.specularRoughness"/> | ||
<float3 name="specularColor" ref="usdPreviewSurfaceLightingAPI2.specularColor"/> | ||
<float name="opacity" ref="opacityToTransparency.opacity"/> | ||
<bool name="useSpecularWorkflow" ref="usdPreviewSurfaceLightingAPI2.useSpecularWorkflow"/> | ||
|
||
<!-- Maya Parameters for Lighting --> | ||
<float3 name="u_viewPosition" semantic="WorldCameraPosition" flags="isRequirementOnly" ref="usdPreviewSurfaceLightingAPI2.u_viewPosition"/> | ||
<int name="mayaExternalLightFunctions" flags="isRequirementOnly" ref="usdPreviewSurfaceLightingAPI2.mayaExternalLightFunctions"/> | ||
<undefined name="GPUStage" ref="mayaComputeSurfaceFinal.GPUStage" semantic="GPUStage"/> | ||
<float3 name="Nw" ref="NwFaceCameraIfNAN.Nw" flags="varyingInputParam"/> | ||
<float3 name="Pw" ref="usdPreviewSurfaceLightingAPI2.Pw" semantic="Pw"/> | ||
<float name="extraOpacity" ref="mayaComputeSurfaceFinal.extraOpacity"/> | ||
<bool name="fogEnabled" ref="mayaComputeSurfaceFinal.fogEnabled"/> | ||
<float4x4 name="ViewProj" ref="maya_FogDepthSurface.ViewProj" semantic="viewprojection"/> | ||
<float name="fogStart" ref="maya_FogDepthSurface.fogStart"/> | ||
<float name="fogEnd" ref="maya_FogDepthSurface.fogEnd"/> | ||
<int name="fogMode" ref="maya_FogDepthSurface.fogMode"/> | ||
<float name="fogDensity" ref="maya_FogDepthSurface.fogDensity"/> | ||
<float4 name="fogColor" ref="mayaComputeSurfaceFinal.fogColor"/> | ||
<float name="fogMultiplier" ref="mayaComputeSurfaceFinal.fogMultiplier"/> | ||
|
||
<!-- The parameter is a workaround for VP2 to execute transparency test. For more details | ||
see PxrMayaUsdPreviewSurfaceShadingNodeOverride::getCustomMappings(). --> | ||
<float name="dummyTransparency" ref="opacityToTransparency.dummyTransparency"/> | ||
</properties> | ||
<values> | ||
<!-- UsdPreviewSurface Parameter Default Values --> | ||
<float name="clearcoat" value="0.0"/> | ||
<float name="clearcoatRoughness" value="0.01"/> | ||
<float3 name="diffuseColor" value="0.18,0.18,0.18"/> | ||
<float3 name="emissiveColor" value="0.0,0.0,0.0"/> | ||
<float name="ior" value="1.5"/> | ||
<float name="metallic" value="0.0"/> | ||
<float name="occlusion" value="1.0"/> | ||
<float name="roughness" value="0.5"/> | ||
<float3 name="specularColor" value="0.0,0.0,0.0"/> | ||
<!-- The shader computes transparency from its "opacity" attribute. --> | ||
<float name="opacity" value="1.0"/> | ||
<bool name="useSpecularWorkflow" value="false"/> | ||
|
||
<!-- Default values for Maya-provided parameters. --> | ||
<float name="extraOpacity" value="1.0"/> | ||
<bool name="fogEnabled" value="false"/> | ||
<float name="fogStart" value="0.0"/> | ||
<float name="fogEnd" value="92.0"/> | ||
<int name="fogMode" value="0"/> | ||
<float name="fogDensity" value="0.1"/> | ||
<float4 name="fogColor" value="0.5,0.5,0.5,1.0"/> | ||
<float name="fogMultiplier" value="1.0"/> | ||
|
||
|
||
<!-- The parameter is a workaround for VP2 to execute transparency test. For more details | ||
see PxrMayaUsdPreviewSurfaceShadingNodeOverride::getCustomMappings(). --> | ||
<float name="dummyTransparency" value="0.0" /> | ||
</values> | ||
<outputs> | ||
<struct name="mayaSurfaceShaderOutput" ref="mayaSurfaceShaderOutput.mayaSurfaceShaderOutput"/> | ||
</outputs> | ||
</fragment_graph> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo?
sef
->set