Hi I am building the Shave and a Haircut Arnold shader plug-in for Arnold Core 126.96.36.199 and MtoA 4.0.1 because if you are unaware Epic games acquired shave from Joe alter recently and they are now offering the source code for the entire shave plugin to the community on GitHub.
I have now successfully compiled the Arnold shave plugin for Arnold 6 however at the moment it only works correctly on the CPU. I am exporting a shave hair test scene as an .ass file from Maya 2018 which has Arnold 188.8.131.52 Core and MtoA 184.108.40.206 installed as I can only get the Shave Maya plugin to work on Maya 2018 as that’s the last version that the shave Maya plugin was officially built for and that version of shave only supported Arnold 220.127.116.11 and MtoA 18.104.22.168
I have all the code to build the shave Maya plugin for Maya 2020 but at the moment I cannot get it to compile and right now I don’t have the time to muck around with all the source code to get it to build, but I do intend to build it for Maya 2020 and maybe also 2019 eventually. But right now I can just build the shave Arnold shader plugin for Arnold 6 and create the required dynamic link library (.dll) as I’m using windows 10 and Visual Studio 2019.
I am compiling a Arnold .exe program which uses the Arnold standalone 22.214.171.124 API, I am not rendering with kick, my program loads the ass file with AiASSload(); where I pass in the file name and AI_NODE_ALL and I return the result of the ass load into a int variable called loadSuccess which equals 0 if the file is successfully found and parsed into Arnold correctly, pretty normal stuff. The ass file is what contains the path to the MtoA shader plugins using options.plugin_searchpath “$ARNOLD_PLUGIN_PATH” which is also where my Arnold 6 shave_shaders-6_0_1_0.dll and simple_shader-6_0_1_0.dll plug-ins are located.
But when Arnold loads in the shave_shaders-6_0_1_0.dll for example with Arnold GPU enabled the console outputs a warning message saying that the shave nodes are unknown to the OptixProgramCache. The .ass file still renders with the shave hair strands actually showing on the mesh object (Arnold curves nodes) but there is no colour where colour is supposed to be, everything is just white? In my shave test scene there is a simple sphere with a shave grass preset on it which is green and the background is white and it is all lit with a Arnold Sky dome light.
I also followed Arnold’s documentation on building a simple shader plugin and ran that on the GPU and got a similar error where the node called “simple” was unknown to the Optix Program Cache.
Link to that simple shader documentation here: https://docs.arnoldrenderer.com/plugins/servlet/mobile#content/view/36110391
In this doc the output image is supposed to be a red circle in the center with a black background surrounding it but again with Arnold GPU it is just rendered white.
As I said earlier these shaders work absolutely perfectly on the CPU with both Arnold 5 and 6.
So what I can understand is that Arnold GPU caches multiple potential scene object combinations in order to accelerate scene compilation for the GPU prior to rendering, and that it does this with a pre population of the GPU optix cache.
I have figured out that I have to somehow get the pre population cache to read my custom shaders so that they can be included in the cache file so that the optix cache can recognise my shaders and use them in renders in the Arnold standalone renderer.
I looked at the 126.96.36.199 Core C++ API Under the Device API and see that there is a function I can call which will pre populate the GPU cache and I tried running this after my ass file had been loaded along with my plugins but I had no luck it didn’t even work I don’t think. I deleted all the cache and Arnold rebuilt it without me needing to call the pre populate cache function anyway but it didn’t include my shaders.
How am I supposed to resolve these Optix program cache warnings messages and make my images render with colour on both the CPU and GPU? As there is no documentation on building shaders or plugins for Arnold GPU yet. I assume that since Arnold GPU is now production ready that it would now support 3rd party shaders and plugins?
Any help or advise would be greatly appreciated.
kind regards, Zach Coley.