-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[hdx] Add shader configurations and mixins to enable occluded selecti…
…on to show through - Add a render pass mixin that writes out whether a fragment is selected in addition to the shaded color. Storm task(s) that use this render pass configuration need to bind an additional AOV (of type float). - Add a render pass mixin that adjusts the alpha component of the computed fragment color to allow occluded selection to show through. This requires a "selected" AOV to be bound and registered for readback in the task. - Add selection mixin for use in the fragment shader to determine if a fragment is selected. (Note: This change does not add the tasks that use these render pass configurations.) (Internal change: 2136475)
- Loading branch information
Showing
7 changed files
with
236 additions
and
2 deletions.
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
67 changes: 67 additions & 0 deletions
67
pxr/imaging/hdx/shaders/renderPassColorAndSelectionShader.glslfx
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,67 @@ | ||
-- glslfx version 0.1 | ||
|
||
// | ||
// Copyright 2020 Pixar | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "Apache License") | ||
// with the following modification; you may not use this file except in | ||
// compliance with the Apache License and the following modification to it: | ||
// Section 6. Trademarks. is deleted and replaced with: | ||
// | ||
// 6. Trademarks. This License does not grant permission to use the trade | ||
// names, trademarks, service marks, or product names of the Licensor | ||
// and its affiliates, except as required to comply with Section 4(c) of | ||
// the License and to reproduce the content of the NOTICE file. | ||
// | ||
// You may obtain a copy of the Apache License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the Apache License with the above modification is | ||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the Apache License for the specific | ||
// language governing permissions and limitations under the Apache License. | ||
// | ||
|
||
--- This is what an import might look like. | ||
--- #import $TOOLS/hdx/shaders/renderPassShader.glslfx | ||
// Render pass shader configuration that writes color and selection information | ||
// (whether the fragment is selected). | ||
|
||
#import $TOOLS/hdSt/shaders/renderPass.glslfx | ||
#import $TOOLS/hdx/shaders/renderPass.glslfx | ||
#import $TOOLS/hdx/shaders/selection.glslfx | ||
|
||
-- configuration | ||
{ | ||
"techniques": { | ||
"default": { | ||
"vertexShader" : { | ||
"source": [ "RenderPass.Camera", | ||
"RenderPass.ApplyClipPlanes" ] | ||
}, | ||
"tessControlShader" : { | ||
"source": [ "RenderPass.Camera", | ||
"RenderPass.ApplyClipPlanes" ] | ||
}, | ||
"tessEvalShader" : { | ||
"source": [ "RenderPass.Camera", | ||
"RenderPass.ApplyClipPlanes" ] | ||
}, | ||
"geometryShader" : { | ||
"source": [ "RenderPass.Camera", | ||
"RenderPass.ApplyClipPlanes" ] | ||
}, | ||
"fragmentShader" : { | ||
"source": [ "RenderPass.Camera", | ||
"RenderPass.ShouldCullFace", | ||
"Selection.DecodeUtils", | ||
"Selection.ComputeColor", | ||
"Selection.Fragment", | ||
"RenderPass.ApplyColorOverrides", | ||
"HdxRenderPass.RenderColorAndSelection" ] | ||
} | ||
} | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
pxr/imaging/hdx/shaders/renderPassColorWithOccludedSelectionShader.glslfx
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,66 @@ | ||
-- glslfx version 0.1 | ||
|
||
// | ||
// Copyright 2020 Pixar | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "Apache License") | ||
// with the following modification; you may not use this file except in | ||
// compliance with the Apache License and the following modification to it: | ||
// Section 6. Trademarks. is deleted and replaced with: | ||
// | ||
// 6. Trademarks. This License does not grant permission to use the trade | ||
// names, trademarks, service marks, or product names of the Licensor | ||
// and its affiliates, except as required to comply with Section 4(c) of | ||
// the License and to reproduce the content of the NOTICE file. | ||
// | ||
// You may obtain a copy of the Apache License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the Apache License with the above modification is | ||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the Apache License for the specific | ||
// language governing permissions and limitations under the Apache License. | ||
// | ||
|
||
--- This is what an import might look like. | ||
--- #import $TOOLS/hdx/shaders/renderPassShader.glslfx | ||
// Render pass shader configuration that writes color and selection information | ||
// (whether the fragment is selected). | ||
|
||
#import $TOOLS/hdSt/shaders/renderPass.glslfx | ||
#import $TOOLS/hdx/shaders/renderPass.glslfx | ||
#import $TOOLS/hdx/shaders/selection.glslfx | ||
|
||
-- configuration | ||
{ | ||
"techniques": { | ||
"default": { | ||
"vertexShader" : { | ||
"source": [ "RenderPass.Camera", | ||
"RenderPass.ApplyClipPlanes" ] | ||
}, | ||
"tessControlShader" : { | ||
"source": [ "RenderPass.Camera", | ||
"RenderPass.ApplyClipPlanes" ] | ||
}, | ||
"tessEvalShader" : { | ||
"source": [ "RenderPass.Camera", | ||
"RenderPass.ApplyClipPlanes" ] | ||
}, | ||
"geometryShader" : { | ||
"source": [ "RenderPass.Camera", | ||
"RenderPass.ApplyClipPlanes" ] | ||
}, | ||
"fragmentShader" : { | ||
"source": [ "RenderPass.Camera", | ||
"RenderPass.ShouldCullFace", | ||
"Selection.DecodeUtils", | ||
"Selection.ComputeColor", | ||
"RenderPass.ApplyColorOverrides", | ||
"HdxRenderPass.RenderColorWithOccludedSelection" ] | ||
} | ||
} | ||
} | ||
} |
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