Jump to content

Recommended Posts

Hi,

I need to calculate the distance from the center of a mesh. It works quite well in a point vop I made, but when I try to do the same thing in my material, the result looks wrong. Does anybody know what the reason might be?

 

viewport.JPG

render.JPG

Share this post


Link to post
Share on other sites

I've had things not to match in SHOPS from SOPS too, and I don't exactly know why. But one thing you can do to get your attribute in SHOPS is to store it in sops using a bind export, and then in SHOPS simply place a parameter node and read back your attribute. it should match exactly. You can later use a fit or a ramp to adjust it in SHOPS and not see the ugly poly edges in case it's not too high poly.

Share this post


Link to post
Share on other sites

Yeah I have had a few times in 16 where I cannot convert my SOPS to SHOPS as well in 16, however sometimes this issue could be fixed by using the mat context instead of shop. Its a long shot, but give it a try.

Share this post


Link to post
Share on other sites

I dont know why, but I assumed you had your material located in a shopnet somewhere. I am saying try to put your material into the mat context instead

Edited by Jesper Rahlff

Share this post


Link to post
Share on other sites
9 minutes ago, GreenGuy said:

ok I will try that, but its going to take a while. there are a ton of references that will  fall apart

 

as I said previously it  have fixed stuff for me a few times, but I don't know why the fix works.. so its a long shot.

Share this post


Link to post
Share on other sites

How are you calculating it? If you just use P in the shader, the position will be in screenspace and not world.

Share this post


Link to post
Share on other sites
1 hour ago, GreenGuy said:

Yeah I thought so, I tried transforming it into world space, but that does not seem to do anything...

Should be something like in pic. That's SHOP, ''current'' space is camera.

spacetransform.png

Share this post


Link to post
Share on other sites
14 minutes ago, GreenGuy said:

yes, I did that. I just put a transform node between the P and the multiply.(To apply it to your example)

Well, then something else went wrong. From my small experience, it works....

Share this post


Link to post
Share on other sites
14 hours ago, Jesper Rahlff said:

if that classic shader is located at /obj/shop try to move it to /obj/mat  instead

Hey, so I did that and it did not really do anything. But it solved a couple of other problems I had, so thank you. Did not expect for shops to fall apart so quickly.

Share this post


Link to post
Share on other sites
1 minute ago, amm said:

Well, then something else went wrong. From my small experience, it works....

Yeah, seems like it I am probably not calculating the centroid the right way. How would you do it? I really have no clue how to do it in a shader, but in a point vop I can just average the bounding box outputs...

Share this post


Link to post
Share on other sites
3 hours ago, GreenGuy said:

Hey, so I did that and it did not really do anything. But it solved a couple of other problems I had, so thank you. Did not expect for shops to fall apart so quickly.

I am glad it at least solved something.. I dunno why but I find that shops throws me wonky errors now and then, so i started to use /mat context instead and it seems to work better.

 

any chance you can share the hip file? a bit easier to help trouble shoot with a file to look at 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×