Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subdivision/Displacement not working #44

Open
kubo-von opened this issue Jan 29, 2020 · 14 comments
Open

Subdivision/Displacement not working #44

kubo-von opened this issue Jan 29, 2020 · 14 comments

Comments

@kubo-von
Copy link
Contributor

kubo-von commented Jan 29, 2020

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:
Screenshot from 2020-01-29 12-31-25

Screenshot from 2020-01-29 12-31-59

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.

@boberfly
Copy link
Owner

Somewhat duplicate of this: #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.

@kubo-von
Copy link
Contributor Author

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

@boberfly
Copy link
Owner

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.

@kubo-von
Copy link
Contributor Author

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.

@boberfly
Copy link
Owner

Yeah I noticed it was single-threaded too, is Blender? Might just need opensubdiv to be compiled with TBB/OpenMP.

@kubo-von
Copy link
Contributor Author

Yeah seems to be the same in Blender, I've just tried it.

@boberfly
Copy link
Owner

Fixed displacement in this commit: 464e139

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).

@kubo-von
Copy link
Contributor Author

Awesome!
Yeah, merging those two makes sense, less nodes to put down.

@boberfly
Copy link
Owner

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...

@boberfly
Copy link
Owner

boberfly commented Feb 3, 2020

Just an update it is partially working:
c763062

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.

@boberfly
Copy link
Owner

boberfly commented Feb 4, 2020

Fixed, seems to work well and also fixes issues with shader hashing.
2554ca8

@kubo-von
Copy link
Contributor Author

kubo-von commented Feb 5, 2020

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 ?

@boberfly
Copy link
Owner

boberfly commented Feb 5, 2020

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!

@kubo-von
Copy link
Contributor Author

kubo-von commented Feb 6, 2020

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants