access meanCurvature() within a blend shader

Feature requests, bug reports and related discussion
Post Reply
7 posts • Page 1 of 1
FakeShamus
Posts: 512
Joined: Wed May 02, 2007 11:34 am

access meanCurvature() within a blend shader

Post by FakeShamus » Thu Jul 14, 2016 9:08 am

Hi, not sure if this is a bug or missing feature, or expected behavior, actually... but trying to use meanCurvature() within a shader to control the blend channel doesn't seem to do anything, you get either 100% material A or material B depending on how you code it, but no transitions that I would expect. when you call that function in the color channel you get very distinct black and white areas, so I thought it would be a natural application to use with blend.
any info on why this doesn't work? am I thinking about it wrong? thanks!

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: access meanCurvature() within a blend shader

Post by galinette » Thu Jul 14, 2016 9:32 am

First, the curvature is signed. Which means the sign changes between concave and convex surfaces

Also, the unit is 1/m, and the value is the reciprocal of the curvature radius. This means that if your surface has features of a few mm, with similar curvature radius, the curvature value will be around 1000.

So your shader will rapidly vary from -1000 to +1000, which means you will not even notice the "gray" zone between 0 and 1

Try something such as 0.5+meanCurvature()*0.001, and if the transition is still too sharp, lower the 0.001 coefficient. If it's too blended, increase it.
Eclat-Digital Research
http://www.eclat-digital.com

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: access meanCurvature() within a blend shader

Post by galinette » Thu Jul 14, 2016 9:39 am

Well, I just tested, and ... it does not work. I think it worked once, but I'm not sure.
Eclat-Digital Research
http://www.eclat-digital.com

User avatar
Oscar J
1st Place Winner
Posts: 2204
Joined: Sat Mar 31, 2012 3:47 am
Location: Gothenburg, Sweden
3D Software: Blender

Re: access meanCurvature() within a blend shader

Post by Oscar J » Thu Jul 14, 2016 9:43 am

I think the next build has a fix for this.

User avatar
arc en ciel
Posts: 138
Joined: Tue Apr 12, 2016 2:33 am

Re: access meanCurvature() within a blend shader

Post by arc en ciel » Thu Jul 14, 2016 10:33 am

yo,
this mat use meanCurvature()
http://www.indigorenderer.com/materials/materials/1144
it works with Indigo 3.8
not with 4

FakeShamus
Posts: 512
Joined: Wed May 02, 2007 11:34 am

Re: access meanCurvature() within a blend shader

Post by FakeShamus » Thu Jul 14, 2016 10:40 am

Aha,
ok, at least I know it should work. Thx guys.

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: access meanCurvature() within a blend shader

Post by OnoSendai » Fri Jul 15, 2016 11:27 pm

Yes, meanCurvature doesn't work in blend params (in Indigo 4 at least).
(Blend params are a bit special).
Just making that work:
Here is a blend betweeen a phong with specular reflectivity, and a brown diffuse material.
Blend shader is

Code: Select all

def eval() real :
   (meanCurvature() + noise(posOS()*20.0)*2.0) > -2.0 ? 1.0 : 0.0
Attachments
curvature_blend_shader_test.jpg

Post Reply
7 posts • Page 1 of 1

Who is online

Users browsing this forum: No registered users and 80 guests