Open kubo-von opened 4 years ago
Somewhat duplicate of this: https://github.com/boberfly/GafferCycles/issues/36
Blender devs decided to do uniform subdiv from Blender so there's no way of doing it outside of adaptive, need to write that one myself. As for displacement you are doing the right thing from what I see.
I've been looking at #36, but that means adaptive should be working? Some subdivision is happening but changing the dicing rate and max subd don't change anything
Cycles might not support changing those settings while it is in IPR mode. Also make sure experimental is set in CyclesOptions. I'll take a look soon.
Ah alright! subdivision works, my apologies! Yeah I had to restart IPR render every time. also I was't putting meaningful values into dicing scale, either to small to see the change or to big that the mesh never generated (seems the subdivision process is single-threaded ? )
No luck with Displacement though.
Yeah I noticed it was single-threaded too, is Blender? Might just need opensubdiv to be compiled with TBB/OpenMP.
Yeah seems to be the same in Blender, I've just tried it.
Fixed displacement in this commit: https://github.com/boberfly/GafferCycles/commit/464e1390ca1c3eb3f1ed9390be54a3b6eb3300d8
Turns out all the settings of the output node wasn't being set to the right node (I somewhat merged the "outputNode" with the actual "shader node" to simplify things, but in the converter forgetting to set the values to the proper respective nodes under the hood).
Awesome! Yeah, merging those two makes sense, less nodes to put down.
One thing which is a big ooof, in interactive rendering when swapping shaders around, it is making Cycles really unstable or it's applying the displacement in an additive way each edit, so it's not fully solved yet. Need to study what Blender is doing to prevent that...
Just an update it is partially working: https://github.com/boberfly/GafferCycles/commit/c7630621dbea23ce12b92963723fc7fdf9116f9a
But John on the forums has given me a better idea, return false on attribute assignment which can't be applied and the renderer interface will send down a new geo, which is exactly what I need to re-generate displacement, especially for adaptive/subdivided geo where my workaround doesn't work.
Fixed, seems to work well and also fixes issues with shader hashing. https://github.com/boberfly/GafferCycles/commit/2554ca813dbf6e3fd26d9cbe95b3fdc4ddcd72a1
Can confirm it works great in 0.16.0 ! Subdiv still needs render restart when changing the tessellation settings, but so does in Blender.. Do you want me to close these once working in current release ?
Hmm I wonder if it's a Cycles limitation. Could you try changing the subdiv settings and then after, do a very small change to displacement and see if the subdiv changes to what it should be? That'll tell me straight away if it's just a hashing issue or that Cycles is not running tessellate during interactive rendering.
Cheers!
I've did what you suggested and after many tries I've failed to find a consistent behavior :/ Sometimes it does update sometimes it doesn't, sometimes it takes a while. I will have more time to play with gaffer and cycles in following weeks so I will do more tests and get back to you if I find any clues.
To be honest I'm not a big fan of Cycles's adaptive tessellation, it's very unpredictable. I have my fingers crossed for #36 :)
Hey @boberfly, I could not get displacement and subdivision to work. Maybe I'm doing something wrong? I didn't find any more settings than these:
Scene here: https://drive.google.com/drive/folders/1YLcuK4VM7Xc_9AobgGI0lbRMbBy2eg4m?usp=sharing
EDIT: Adding meshType node set to Subdivision Surface seems to do something, even though the cycles attributes have no effect and still no Displacement happening.