Oh, bummer.

Thanks so much for the background info.

I suppose  there isn't a way for a Material to modify the VertexContext in
vertex_shader, but still pass the original VertexContext to the shading
tree, right?

The thing is, I've been using some of the predefined attributes to pass
arbitrary data to the fragment_shader. My only concern is that if you stack
another material that wants to use that attribute, it will pick up my
modified VertexContext, right?
Not a big deal, since this material is rather specific, but just wanted to
see if there was a different way to tackle this.

Thanks,
Ivan

On Wed, Sep 14, 2011 at 3:23 PM, Jonathan Egstad <jegs...@earthlink.net>wrote:

> > Is it possible to add attributes other than the predefined ones to a
> VArray passed through the vertex shader, and have the vertex_shader
> interpolate them?
>
> Short answer - not really...
>
> Long answer - the VArray structure was originally just a wrapper around a
> Pixel structure which contained 1024 floats.  The Channel3D assignments were
> defaults with the ability to declare add'l varying attributes - but it was
> quickly identified as a memory hog during rasterization and was trimmed down
> drastically.  Unfortunately much of the varying attribute support went away
> with that change - and the AttribContext copy_to_channels() is a remnant.
>
> The ultimate answer is to not pre-cache all the interpolating vertex data
> as is done now but to generate it on demand - I think with today's CPUs and
> the large number of engine threads that swapping CPU time for memory in this
> part of the algorithm (you'd end up recalculating the same vertex data
> possibly hundreds of times) would be  a big win - especially since rendering
> large poly scenes can often take a machine into swap.
>
> -jonathan
>
>
> > So far, if I want to pass some arbitrary info onto the fragment_shader,
> I've just been forcing it into any of the predefined slots (PW, PL, N...)
> that I don't need in the fragment shader.
> > But I was wondering if it's possible to add new attributes.
> >
> > I notice AttribContext has a "copy_to_channels" method that sounds like I
> could use for this, but I'm not sure how to go about creating a new
> AttribContext, and filling it with my data.
> >
> > In any case, would that be the best approach to append arbitrary data to
> a Varray? Can anyone share any pointers/examples/help?
> >
> > Many thanks,
> > Ivan
> > _______________________________________________
> > Nuke-dev mailing list
> > Nuke-dev@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>
> _______________________________________________
> Nuke-dev mailing list
> Nuke-dev@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>
_______________________________________________
Nuke-dev mailing list
Nuke-dev@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev

Reply via email to