C# 클래스 idTech4.Renderer.idMaterial

Material.
Any errors during parsing just set MF_DEFAULTED and return, rather than throwing a hard error. This will cause the material to fall back to default material, but otherwise let things continue.

Each material may have a set of calculations that must be evaluated before drawing with it.

Every expression that a material uses can be evaluated at one time, which will allow for perfect common subexpression removal when I get around to writing it.

Without this, scrolling an entire surface could result in evaluating the same texture matrix calculations a half dozen times.

Open question: should I allow arbitrary per-vertex color, texCoord, and vertex calculations to be specified in the material code?

Every stage will definately have a valid image pointer.

We might want the ability to change the sort value based on conditionals, but it could be a hassle to implement,

상속: idTech4.Text.idDecl
파일 보기 프로젝트 열기: iainmckay/idtech4.net 1 사용 예제들

공개 메소드들

메소드 설명
AddReference ( ) : void
EvaluateRegisters ( float &registers, float shaderParms, View view ) : void
EvaluateRegisters ( float &registers, float shaderParms, View view, idSoundEmitter soundEmitter ) : void
GetStage ( int index ) : MaterialStage
Parse ( string text ) : bool

Parses the current material definition and finds all necessary images.

TestMaterialFlag ( MaterialFlags flag ) : bool

Test for existance of specific material flag(s).

idMaterial ( ) : System

보호된 메소드들

메소드 설명
ClearData ( ) : void
GenerateDefaultText ( ) : bool

비공개 메소드들

메소드 설명
AddImplicitStages ( TextureRepeat textureRepeatDefault = TextureRepeat.Repeat ) : void

Adds implicit stages to the material.

If a material has diffuse or specular stages without any bump stage, add an implicit _flat bumpmap stage.

It is valid to have either a diffuse or specular without the other.

It is valid to have a reflection map and a bump map for bumpy reflection.

AppendToken ( StringBuilder b, idToken token ) : void
CheckForConstantRegisters ( ) : void

As of 5/2/03, about half of the unique materials loaded on typical maps are constant, but 2/3 of the surface references are. This is probably an optimization of dubious value.

CheckSurfaceParameter ( idToken token ) : bool

See if the current token matches one of the surface parameter bit flags.

Clear ( ) : void
EmitOp ( int a, int b, ExpressionOperationType opType ) : int
GetDestinationBlendMode ( string name ) : MaterialStates
GetExpressionConstant ( float f ) : int
GetExpressionOperation ( ) : ExpressionOperation
GetExpressionTemporary ( ) : int
GetSourceBlendMode ( string name ) : MaterialStates
MatchAndAppendToken ( StringBuilder b, idLexer lexer, string match ) : void
MatchToken ( idLexer lexer, string match ) : bool

Sets defaultShader and returns false if the next token doesn't match.

MultiplyTextureMatrix ( TextureStage &textureStage, int registers ) : void
ParseBlend ( idLexer lexer, MaterialStage &stage ) : void
ParseDecalInfo ( idLexer lexer ) : void
ParseDeform ( idLexer lexer ) : void
ParseEmitOp ( idLexer lexer, int a, ExpressionOperationType opType, int priority ) : int
ParseExpression ( idLexer lexer ) : int

ParseExpressionPriority ( idLexer lexer, int priority ) : int
ParseFragmentMap ( idLexer lexer, NewMaterialStage &newStage ) : void
ParseMaterial ( idLexer lexer ) : void

Parses the material, if there are any errors during parsing the defaultShader will be set.

ParsePastImageProgram ( idLexer lexer ) : string
ParseSort ( idLexer lexer ) : void
ParseStage ( idLexer lexer, TextureRepeat textureRepeatDefault ) : void
ParseTerm ( idLexer lexer ) : int

ParseVertexParameter ( idLexer lexer, NewMaterialStage &newStage ) : void

Parses a vertex parameter.

If there is a single value, it will be repeated across all elements. If there are two values, 3 = 0.0, 4 = 1.0. if there are three values, 4 = 1.0.

SortInteractionStages ( ) : void

Sorts the shader stages.

The renderer expects bump, then diffuse, then specular There can be multiple bump maps, followed by additional diffuse and specular stages, which allows cross-faded bump mapping. Ambient stages can be interspersed anywhere, but they are ignored during interactions, and all the interaction stages are ignored during ambient drawing.

메소드 상세

AddReference() 공개 메소드

public AddReference ( ) : void
리턴 void

ClearData() 보호된 메소드

protected ClearData ( ) : void
리턴 void

EvaluateRegisters() 공개 메소드

public EvaluateRegisters ( float &registers, float shaderParms, View view ) : void
registers float
shaderParms float
view View
리턴 void

EvaluateRegisters() 공개 메소드

public EvaluateRegisters ( float &registers, float shaderParms, View view, idSoundEmitter soundEmitter ) : void
registers float
shaderParms float
view View
soundEmitter idSoundEmitter
리턴 void

GenerateDefaultText() 보호된 메소드

protected GenerateDefaultText ( ) : bool
리턴 bool

GetStage() 공개 메소드

public GetStage ( int index ) : MaterialStage
index int
리턴 MaterialStage

Parse() 공개 메소드

Parses the current material definition and finds all necessary images.
public Parse ( string text ) : bool
text string
리턴 bool

TestMaterialFlag() 공개 메소드

Test for existance of specific material flag(s).
public TestMaterialFlag ( MaterialFlags flag ) : bool
flag MaterialFlags
리턴 bool

idMaterial() 공개 메소드

public idMaterial ( ) : System
리턴 System