|
Fish - FiberLib for VISH 0.3
Fish - The Fiber Bundle API for the Vish Visualization Shell
|
Public Types | |
| using | ShaderFields_t = map<string, TypedSlot<Fiber::FieldSelector> > |
| Mapping from shader attribute names to input field selectors. | |
| using | string_set = std::unordered_set<string> |
| using | getSkeletonFieldsResults_t = map<string, RefPtr<Fiber::Field> >::value_type |
| using | FieldValidator_t |
Public Member Functions | |
| ShaderFields (VObject *that, const string &AllowImplicitFieldsSlotName="AllowImplicitFields", int AllowImplicitFieldsSlotEL=9) | |
| string_set | getShaderDefaultFields (const string &Shaderfield) const |
| bool | isNewerThan (const Ageable &A) const |
| getSkeletonFieldsResults_t | getSkeletonField (const RefPtr< Fiber::Skeleton > &DestVertexSkeleton, const RefPtr< Fiber::Chart > &chart, const string &ShaderfieldName, const RefPtr< ValuePool > &Context, const FieldSelector &FS) const |
| virtual bool | validateFragment (const RefPtr< ValuePool > &Context, const RenderNamespace::glsl &FieldID, const RefPtr< Fiber::FragmentID > &FID, const WeakPtr< Fiber::FiberTypeBase > &FTB, int ElementTextureLength) const |
| bool | validateFields (VRequest &Context, const RefPtr< Fiber::Skeleton > &theSkeleton, const RefPtr< Fiber::Chart > &chart, const FieldValidator_t &FV, string &ValidateInputInfoString) const |
| bool | isMandatoryShaderAttribute (const string &AttributeName) const |
| Check whether a given shader attribute must be provided. | |
| bool | addField (VRequest &Context, const RefPtr< Fiber::Skeleton > &theSkeleton, const RefPtr< Fiber::Chart > &chart, const TypedSlot< Fiber::FieldSelector > &theFieldSelector, const RenderNamespace::glsl &AttributeName, RenderFields &Result, string &InfoString) |
| Add a field to the provided FieldList. | |
| bool | addFields (VRequest &Context, const RefPtr< Fiber::Skeleton > &theSkeleton, const RefPtr< Fiber::Chart > &chart, RenderFields &Result, string &InfoString) |
| Add all stored fields to the provided FieldList. | |
| RenderNamespace::glsl | getShaderDefinitions (const RefPtr< ValuePool > &Context, const RenderNamespace::glsl &FieldID, const Fiber::Field &F, const RefPtr< Fiber::FragmentID > &FID, const RefPtr< Fiber::SizeInterface > &PrimaryDataFragmentSize) const |
| RenderNamespace::glsl | getFieldsShaderDefinitions (const RefPtr< ValuePool > &Context, const RenderFields::RefinementIndex &SkeletonID, const RefPtr< Fiber::FragmentID > &FID, const RefPtr< Fiber::SizeInterface > &PrimaryDataFragmentSize, const RenderFields &RF) const |
| RenderNamespace::glsl | getFieldsShaderPrefix (const RefPtr< ValuePool > &Context, const RenderFields::RefinementIndex &SkeletonID, const RefPtr< Fiber::FragmentID > &FID, Fiber::CreativeArrayBase &myPrimaryDataFragment, const RenderFields &RF) const |
Static Public Member Functions | |
| static getSkeletonFieldsResults_t | getSkeletonField (const RefPtr< Fiber::Skeleton > &DestVertexSkeleton, const RefPtr< Fiber::Chart > &chart, const FieldSelector &FS, const string_set &ImplicitFieldNames, bool AllowImplicitFields) |
| Provide a field on a skeleton, considering possibly given implicit field names, i.e. | |
| static RenderNamespace::glsl | getPositionsShaderFunction (const Fiber::CreativeArrayBase &theCoordinateFragment) |
| Defines functions in the vertex shader that allow to compute positions also from uniform coordinates. | |
Public Attributes | |
| ShaderFields_t | myShaderFields |
| Map from names used in the GLSL code to input field slots. | |
| VObject::in< bool > | inAllowImplicitFields |
| std::unordered_map< string, string_set > | myShaderDefaultFields |
| For each shader field optionally provide a name for the field on the Grid. | |
| std::unordered_set< std::string > | MandatoryShaderAttributes |
Static Public Attributes | |
| static const char | define_ATTRIBUTE_INDEX_LOCATION [] |
| A glsl macro to define a. | |
| using Wizt::ShaderFields::FieldValidator_t |
| bool Wizt::ShaderFields::addFields | ( | VRequest & | Context, |
| const RefPtr< Fiber::Skeleton > & | theSkeleton, | ||
| const RefPtr< Fiber::Chart > & | chart, | ||
| RenderFields & | Result, | ||
| string & | InfoString ) |
Add all stored fields to the provided FieldList.
To be called from addSupplementaryData() .
References addFields(), getSkeletonField(), isMandatoryShaderAttribute(), and myShaderFields.
Referenced by addFields(), and getSkeletonField().
|
static |
Defines functions in the vertex shader that allow to compute positions also from uniform coordinates.
References MemCore::CreatorBase< class Domain >::get(), getPositionsShaderFunction(), and Wizt::UniformVertexAttribute::getShaderDefines().
Referenced by getPositionsShaderFunction(), and getSkeletonField().
| RenderNamespace::glsl Wizt::ShaderFields::getShaderDefinitions | ( | const RefPtr< ValuePool > & | Context, |
| const RenderNamespace::glsl & | FieldID, | ||
| const Fiber::Field & | F, | ||
| const RefPtr< Fiber::FragmentID > & | FID, | ||
| const RefPtr< Fiber::SizeInterface > & | PrimaryDataFragmentSize ) const |
Support for arrays per vertex via texture buffers.
References define_ATTRIBUTE_INDEX_LOCATION, Fiber::DataRange< Type >::get_cached_range(), Fiber::Field::getCreator(), Fiber::Field::getElementFiberType(), Fiber::Field::getElementType(), Wizt::UniformVertexAttribute::getShaderDefines(), getShaderDefinitions(), Wizt::Range::Max(), Wizt::Range::Min(), Fiber::FragmentID::Name(), std::to_string(), and MemCore::Typename().
Referenced by getShaderDefinitions(), and getSkeletonField().
|
static |
Provide a field on a skeleton, considering possibly given implicit field names, i.e.
if no field can be found via the FieldSelector, then go via the implicit field names as given by a list of strings.
References addField(), addFields(), getPositionsShaderFunction(), getShaderDefinitions(), getSkeletonField(), and isMandatoryShaderAttribute().
Referenced by addField(), addFields(), Wizt::FieldAnemone::addSupplementaryData(), getSkeletonField(), and Wizt::FieldAnemone::validateInput().
| bool Wizt::ShaderFields::isMandatoryShaderAttribute | ( | const string & | AttributeName | ) | const |
Check whether a given shader attribute must be provided.
This function simply checks its mentioning in the MandatoryShaderAttributes member array.
References isMandatoryShaderAttribute().
Referenced by addField(), addFields(), Wizt::FieldAnemone::addSupplementaryData(), getSkeletonField(), and isMandatoryShaderAttribute().
|
staticconstinit |
A glsl macro to define a.
attribute for vertex attributes, but only for GLSL version higher than 3.3, otherwie it is empty.
Referenced by getShaderDefinitions().
| ShaderFields_t Wizt::ShaderFields::myShaderFields |
Map from names used in the GLSL code to input field slots.
This map has to be filled in the derived object's constructor or setup function / functor. For instance:
The specified field's data will then appears as vertex shader attribute
Referenced by addFields().