Skip to content

Commit

Permalink
3Delight ShaderNetworkAlgo : Translate UsdPreviewSurface to 3Delight
Browse files Browse the repository at this point in the history
  • Loading branch information
murraystevenson authored and johnhaddon committed Apr 30, 2024
1 parent 33839a4 commit 05939bf
Show file tree
Hide file tree
Showing 12 changed files with 1,063 additions and 53 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Improvements
- AttributeTweaks, CameraTweaks, ShaderTweaks, OptionTweaks, PrimitiveVariableTweaks :
- Added support for a `{source}` token which is substituted with the original value when tweaking a string in `Replace` mode.
- Added tooltips documenting the tweak modes.
- 3Delight : Added automatic render-time translation of UsdPreviewSurface shaders to 3Delight.

Fixes
-----
Expand Down
1 change: 1 addition & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,7 @@ libraries = {
],
},
"pythonEnvAppends" : {
"CPPPATH" : [ "$DELIGHT_ROOT/include" ],
"LIBS" : [ "IECoreScene$CORTEX_LIB_SUFFIX", "IECoreDelight" ],
},
"requiredOptions" : [ "DELIGHT_ROOT" ],
Expand Down
7 changes: 7 additions & 0 deletions include/IECoreDelight/ShaderNetworkAlgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@

#include "IECoreScene/ShaderNetwork.h"

#include <nsi.h>

namespace IECoreDelight
{

Expand All @@ -54,6 +56,11 @@ const char *lightGeometryType( const IECoreScene::ShaderNetwork *shaderNetwork )
/// `state` is used to store the current state and avoid unnecessary edits.
void updateLightGeometry( const IECoreScene::ShaderNetwork *shaderNetwork, NSIContext_t context, const char *handle, IECore::MurmurHash &state );

/// Converts any UsdPreviewSurface shaders and UsdLuxLights into native 3Delight shaders. This conversion
/// is performed automatically by `preprocessedNetwork()` and is mainly just exposed for the unit
/// tests.
IECOREDELIGHT_API void convertUSDShaders( IECoreScene::ShaderNetwork *shaderNetwork );

} // namespace ShaderNetworkAlgo

} // namespace IECoreDelight
Loading

0 comments on commit 05939bf

Please sign in to comment.