CGTalk > Software > Maxon Cinema 4D
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 11-14-2012, 10:36 PM   #1
sboyd
Frequenter
 
sboyd's Avatar
Stephen Boyd
Animation Director
Nucleus Medical Media
Kennesaw, USA
 
Join Date: Feb 2006
Posts: 126
Problems with Hair Transparency/Length Mapping

So I have a couple of planes on top of some cubes, and bend deformers that pull the planes away from the cubes (see attachment). As the planes pull away from the cubes, they change color from cyan to red. This effect is accomplished using different shaders: One a proximal shader, and the other a 3D gradient in world space.

Both the planes have hair on them. The hair changes color from cyan to red using the exact same shaders that change the color on the planes. The problem that I am having is that when I try to use those same shaders on the transparency channel or the length channel of the hair material, it doesn't work. You can seen on the "Proximal" set, the hair transparency and length aren't affected at all. On the "3D Gradient" set, they effect can be seen but is completely different than what is expected based on the results in the color channel.

I am pulling my hair out over this (no pun intended). Why does it seem to work differently for different channels in the hair material? This is especially baffling since it is using a proximal and 3D gradient in world space, both which you would think would affect all objects and channel in the same way. There must be something simple that I am missing. A checkbox somewhere? Any help is appreciated. Thanks!

Stephen
 
Old 11-15-2012, 07:18 AM   #2
obeardy
Expert
portfolio
David O'Reilly
Managing Director/Developer
INSYDIUM LTD
United Kingdom
 
Join Date: Jul 2003
Posts: 382
Quote:
Originally Posted by sboyd
Why does it seem to work differently for different channels in the hair material? This is especially baffling since it is using a proximal and 3D gradient in world space, both which you would think would affect all objects and channel in the same way. There must be something simple that I am missing. A checkbox somewhere? Any help is appreciated. Thanks!

Shaders can be evaluated in two ways in CINEMA, first is with just a ChannelData passed to the shader in which case the shader is supplied with only a UV coordinate. It does not know the object it is shading or have any of the raytracing available to it. The second is with UVs and full 3D information/raytracing (a full VolumeData).

Shaders like proximal and my own render boolean (which can also do effects like proximal using the distance mode) need the full 3d data (VolumeData). They need to know about the object that they are shading and the other objects plus may need the full render environment available to them. When they are passed only a UV coordinate they simply can not work (or generate a preview output only). A good indication is what you see in the viewport.

In hair the styling options to frizz and change the length etc. are not done within the rendering, they are done before it so can only supply UVs to the shaders. This means only UV shaders can work, any 3D shader will not work.

I ran into this problem with my own shader last week, someone wanted to use it with X-Particles but as with hair that only supplies UVs (you can't supply the full data without a full render environment). Think of what proximal is doing, it needs to calculate distances from the object it is shading to the other objects, my plugin does something similar. With only UVs it simply can't do this, the shaders don't even know which object they are shading.

I got around this problem in my shader (in v0.42a) by adding a UV Sampling option combined with a link in the shader to tell it which object it is using for its base of measurement (the object it would be shading). This enables it to work with only a UV coordinate, something proximal can not do.
__________________
www.x-particles.com
Developer

A question that sometimes drives me hazy, am I or are the others crazy?

Last edited by obeardy : 11-15-2012 at 07:20 AM.
 
Old 11-15-2012, 12:59 PM   #3
sboyd
Frequenter
 
sboyd's Avatar
Stephen Boyd
Animation Director
Nucleus Medical Media
Kennesaw, USA
 
Join Date: Feb 2006
Posts: 126
Hey thanks for the feedback. I do understand what you are saying, and that's good information to have about what is going on behind the scenes. It is still confusing though because one shader works fine in the Color Channel of the hair material but ceases to work for the others such as Transparency or Length. Just seems inconsistent, and I'm still not quite sure how to get around it, or accomplish what I want to accomplish.
 
Old 11-15-2012, 01:16 PM   #4
obeardy
Expert
portfolio
David O'Reilly
Managing Director/Developer
INSYDIUM LTD
United Kingdom
 
Join Date: Jul 2003
Posts: 382
Quote:
Originally Posted by sboyd
Hey thanks for the feedback. I do understand what you are saying, and that's good information to have about what is going on behind the scenes. It is still confusing though because one shader works fine in the Color Channel of the hair material but ceases to work for the others such as Transparency or Length. Just seems inconsistent, and I'm still not quite sure how to get around it, or accomplish what I want to accomplish.

The color can be applied during rendering so the shaders have a render environment and can work fully, it is just a limitation and a common one when using shaders outside of the renderer.

Proximal can't be used, but I have something that might. PM me, I might be able to help.
__________________
www.x-particles.com
Developer

A question that sometimes drives me hazy, am I or are the others crazy?
 
Old 11-15-2012, 01:16 PM   #5
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,480
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 07:11 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.