v2.0.2
Instance Methods | Class Methods | List of all members
CC3ShaderSemanticsBase Class Reference

#import <CC3ShaderSemantics.h>

Inheritance diagram for CC3ShaderSemanticsBase:
Inheritance graph
[legend]

Instance Methods

(BOOL) - configureVariable:
 
(NSString *) - nameOfSemantic:
 
(BOOL) - populateUniform:withVisitor:
 

Class Methods

(id) + semanticsDelegate
 

Detailed Description

CC3ShaderSemanticsBase is an abstract implementation of the CC3ShaderSemanticsDelegate protocol, that retrieves common uniform values from the scene based on those semantics.

This implementation can be used as a superclass for other implementations. Semantic assigment heuristics may be radically different across implementations, but there is much commonality in the retrieval and assignment of uniform variables using the populateUniform:withVisitor: method. In many cases, subclassing this implementation, and using the inherited populateUniform:withVisitor: method, possibly overriding to provide additional variable assignment behaviour, can provide significant useful functionality.

This implementation does not provide any behaviour for the configureVariable: method, which simply returns NO.

The nameOfSemantic: method returns a name for each standard semantics defined in the CC3Semantic enumeration. If a subclass adds additional semantic definitions of its own, it should override that method to provide a string representation of the semantic value.

Method Documentation

- (BOOL) configureVariable: (CC3GLSLVariable *)  variable

This implementation does not provide any configuration behaviour, and simply returns NO.

Subclasses will add behaviour to configure variables according to customized semantic mapping.

Reimplemented from <CC3ShaderSemanticsDelegate>.

Implemented in CC3ShaderSemanticsByVarName.

- (NSString*) nameOfSemantic: (GLenum)  semantic

Returns a string description of the specified semantic.

This implementation calls the NSStringFromCC3Semantic method to return a name for each of the standard semantics defined in the CC3Semantic enumeration. If a subclass adds additional semantic definitions of its own, it should override this method to provide a string representation of any new semantic values.

Reimplemented from <CC3ShaderSemanticsDelegate>.

- (BOOL) populateUniform: (CC3GLSLUniform *)  uniform
withVisitor: (CC3NodeDrawingVisitor *)  visitor 

Populates the specified uniform from standard content extracted from the scene.

This implementation provides significant standard behaviour for most standard semantics. Subclasses can use this as a starting point, and add content extraction for customized semantics, or can override the behaviour of this method for specific uniforms or semantics.

Reimplemented from <CC3ShaderSemanticsDelegate>.

+ (id) semanticsDelegate

Allocates and initializes an autoreleased instance.


The documentation for this class was generated from the following file: