Skip to content

Commit

Permalink
IECoreDelight : Add display driver
Browse files Browse the repository at this point in the history
This was originally provided by Cortex, and installed as a `.so` which 3Delight loaded via the `DL_DISPLAYS_PATH`. But more recent versions of 3Delight have ditched the search path and therefore can't find the `.so`. So instead, we move the code to IECoreDelight and register it directly via `DspyRegisterDriverTable`. This seems to be what the 3Delight developers recommend.

There are two potential downsides here :

- Presumably we can't write a `.nsi` file containing an `ieDisplay` and then render it directly with `renderdl`, because the driver won't be registered.
- We're no longer sharing the implementation with a potential PRMan display driver.

The alternative would be to continue to use a `.so`, but do the search path resolution ourself, and pass the full path to 3Delight. But then the resulting `.nsi` file is non-portable because it's hardcoded to the installation location (and platform) that it was written from.

Only time will tell what the right decision is here, but I'm currently swayed by the simplicity of hosting the display driver directly in IECoreDelight, and being able to remove one more component from Cortex.
  • Loading branch information
johnhaddon committed Jan 9, 2023
1 parent 6f3e955 commit 149efcd
Show file tree
Hide file tree
Showing 5 changed files with 381 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
1.2.0.0ax (relative to 1.2.0.0a1)
=========

Fixes
-----

- 3Delight : Fixed rendering with recent versions of 3Delight, which no longer use the `DL_DISPLAYS_PATH` to search for display drivers.

API
---

Expand Down
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ libraries = {
"LIBPATH" : [ "$DELIGHT_ROOT/lib" ],
## \todo Remove GafferScene. We need it at present to get access to `IECoreScenePreview::Renderer`,
# but IECoreDelight must never depend on Gaffer code; logically it is in the layer below Gaffer.
"LIBS" : [ "GafferScene", "3delight", "IECoreScene$CORTEX_LIB_SUFFIX" ],
"LIBS" : [ "GafferScene", "3delight", "IECoreImage$CORTEX_LIB_SUFFIX", "IECoreScene$CORTEX_LIB_SUFFIX" ],
},
"pythonEnvAppends" : {
"LIBS" : [ "IECoreScene$CORTEX_LIB_SUFFIX", "IECoreDelight" ],
Expand Down
1 change: 0 additions & 1 deletion bin/gaffer
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ if [[ -n $DELIGHT ]] ; then
appendToPath "$DELIGHT/bin" PATH
appendToPath "$DELIGHT/python" PYTHONPATH
appendToPath "$DELIGHT/shaders" DL_SHADERS_PATH
appendToPath "$DELIGHT/displays" DL_DISPLAYS_PATH

appendToPath "$DELIGHT" OSL_SHADER_PATHS

Expand Down
3 changes: 1 addition & 2 deletions bin/gaffer.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ if "%DELIGHT%" NEQ "" (
call :appendToPath "%DELIGHT%\bin" PATH
call :appendToPath "%DELIGHT%\python" PYTHONPATH
call :appendToPath "%DELIGHT%\shaders" DL_SHADERS_PATH
call :appendToPath "%DELIGHT%\displays" DL_DISPLAYS_PATH


call :appendToPath "%DELIGHT%" OSL_SHADER_PATHS

call :appendToPath "%GAFFER_ROOT%\renderMan\displayDrivers" DL_RESOURCES_PATH
Expand Down
Loading

0 comments on commit 149efcd

Please sign in to comment.