Class: shadercghostparam

A Cg Parameter that serves as host to all parameters with the same name. Use it to make it easier to control many parameters thru one with optimal efficiency. Directly creates a CGparam and connects the ones found in gpuprograms. Such parameters may not be controlled individually in a shader. Be aware that there is not much error checking done on parameter value get/set. If arrays passed are too small or length is set incorrect there will be no error warning.

Methods:

Method overview:


create (string name, string cgtypename, [int size])
returns: ([shadercghostparam])
creates a parameter with the given name (or returns nil if name is already in use). Typename can be found in the Cg documentary. For array types the size value is taken.
destroy (string name)
returns: (int users)
tries to destroy the parameter, will return the number of still dependent parameters when parameter could not be destroyed, as its still in use.
get (string name)
returns: ([shadercghostparam])
gets parameter or returns nil if noone with the name is registered
sizes (shadercghostparam)
returns: (int columns, int rows, int totalarraysize)
returns various dimensions of parameter
value (shadercghostparam, [float x,y,z,w / matrix16 / staticarray], [int offset, length])
returns: ([float x,y,z,w / matrix16 / staticarray])
sets/gets the value of a parameter, depending on type it will return/need different types. Arrays will alwas need corresponding staticarray (float/int), whilse matrices use matrix16 and vectors or scalars are directly pushed/popped on stack. When arrays are accessed you can fill them with an offset value. Counters for those are always single scalars. Return will always return the full array
valueinto (shadercghostparam, matrix16 / staticarray, [int offset])
returns: (matrix16 / staticarray)
similar to value, but performs a get into the given parameters. Will not work for single vectors.