> 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 > [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
