Hi,
in Nuke 6.3 the ColoredShader2 is a private material used by particles
when no material is assigned.
The purpose of this material is to allow particles to render with a colour
instead to be black.
It's not been designed to generate any texture. You should use only the
fragment_shader part of it.
The material simply set the final Pixel color as the particle color with
alpha.
If some lights are present in the scene it also perform a diffuse shading.
To get the particle color inside a fragment_shader you can interrogate
VertexContext class.
void ColoredShader2::fragment_shader(const VertexContext& vtx, Pixel& out)
{
const float iw = 1.0f / vtx.w();
float a = vtx.a() * iw;
float r = vtx.r() * iw;
float g = vtx.g() * iw;
float b = vtx.b() * iw;
In general the VertexContext class keeps the interpolated color of the
polygon vertices.
If you need you can get color attribute also from the GeoInfo.
In case of particle geo, the color attribute is stored by Group_Object
under the name DD::Image::kColorAttrName.
You can get it calling the following method
GeoInfo::get_attribcontext(kColorAttrName).
In Material.h is also available ColoredShader.
The behaviour is the same as ColoredShader2 if no lights are present in the
scene.
When lights are present the final pixel composition is different. And it
loose the capability
to modulate the sample by the particle alpha.
To avoid to break any render compatibility for 6.3 we decide to introduce
an internal material for particle: ColoredShader2.
Cheers,
Pierluigi
On Tue, Jun 26, 2012 at 11:29 AM, Paolo Berto <[email protected]>wrote:
> Can any folk @ the foundry shine some light on this one?
>
> FTI this is also logged as [Ticket#2012062510000151] What is "ColoredShad
> [...]
>
> Best,
>
> Paolo
>
> On Thu, Jun 21, 2012 at 10:37 PM, Moritz Moeller <[email protected]>wrote:
>
>> This is the node class I get from geo instanced on particles that have
>> no material assigned.
>>
>> Although this identifies itself as an Iop, calling get() on it (after a
>> validate() and request()) makes Nuke kiss the daisies instantly (this
>> should probably be fixed).
>>
>> Currently I ignore this node, but I'd rather do sth. clever when
>> encountering it. So my questions are:
>>
>> 1. What is this node (purpose, functionality, etc.)?
>> 2. How can I query data from it (i.e. particle color etc?)
>> 3. Is there a "ColoredShader(1)" node and if so, how about 1 & 2 reg.
>> that one?
>>
>>
>> .mm
>> _______________________________________________
>> Nuke-dev mailing list
>> [email protected], http://forums.thefoundry.co.uk/
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>>
>> --
>> paolo berto durante
>> space
>> cowboy<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev>
>> jupiter jazz limited, hong kong
>> <http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev>
>> http://jupiter-jazz.com
>> https://atomkraft.hk
>>
>>
>
> _______________________________________________
> Nuke-dev mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>
>
_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev