| Description | Hierarchy | Fields | Methods | Properties |
type TVRMLOpenGLRenderer = class(TObject)
![]() |
constructor Create(AttributesClass: TVRMLRenderingAttributesClass; ACache: TVRMLOpenGLRendererContextCache); |
![]() |
destructor Destroy; override; |
![]() |
procedure Prepare(State: TVRMLGraphTraverseState); |
![]() |
procedure Unprepare(Node: TVRMLNode); |
![]() |
procedure UnprepareAll; |
![]() |
procedure RenderBegin(FogNode: TNodeFog; const FogDistanceScaling: Single); |
![]() |
procedure RenderEnd; |
![]() |
procedure RenderShapeStateBegin(Node: TNodeGeneralShape; State: TVRMLGraphTraverseState); |
![]() |
procedure RenderShapeStateNoTransform(Node: TNodeGeneralShape; State: TVRMLGraphTraverseState); |
![]() |
procedure RenderShapeStateEnd(Node: TNodeGeneralShape; State: TVRMLGraphTraverseState); |
![]() |
procedure RenderShapeState(Node: TNodeGeneralShape; State: TVRMLGraphTraverseState); |
![]() |
function BumpMappingMethod: TBumpMappingMethod; |
![]() |
class function GLContextBumpMappingMethod( const FirstGLFreeTexture: Cardinal; ALastGLFreeTexture: Integer; const AttributesBumpMappingMaximum: TBumpMappingMethod; const AttributesEnableTextures, AttributesPureGeometry: boolean): TBumpMappingMethod; |
![]() |
property Attributes: TVRMLRenderingAttributes read FAttributes; |
![]() |
property Cache: TVRMLOpenGLRendererContextCache read FCache; |
![]() |
property BumpMappingLightPosition: TVector3Single
read FBumpMappingLightPosition write SetBumpMappingLightPosition; |
![]() |
property BumpMappingLightAmbientColor: TVector4Single
read FBumpMappingLightAmbientColor
write SetBumpMappingLightAmbientColor; |
![]() |
property BumpMappingLightDiffuseColor: TVector4Single
read FBumpMappingLightDiffuseColor
write SetBumpMappingLightDiffuseColor; |
![]() |
constructor Create(AttributesClass: TVRMLRenderingAttributesClass; ACache: TVRMLOpenGLRendererContextCache); |
|
Constructor. Passing nil as Cache will cause the private cache instance to be created and used for this TVRMLOpenGLRenderer. I.e. no cache will be shared between different TVRMLOpenGLRenderer instances. Otherwise you can pass here your Cache. Of course it has to remain created for the whole lifetime while this TVRMLOpenGLRenderer is created. | |
![]() |
destructor Destroy; override; |
![]() |
procedure Prepare(State: TVRMLGraphTraverseState); |
|
przygotuj stan State aby moc pozniej renderowac shape'y ze stanem State. Od tego momentu do wywolania Unprepare[All] node'y przekazane tu jako Last*/Active* sa "zamrozone" : nie mozna zrobic im Free, nie mozna zmienic ich zawartosci. | |
![]() |
procedure Unprepare(Node: TVRMLNode); |
|
zniszcz powiazania renderera z danym node'em i z zasobami OpenGL'a jakie byly utworzone w ramach "przygotowan do wyswietlenia tego node'a" jako Last*/Active* node w jakims State. | |
![]() |
procedure UnprepareAll; |
|
zniszcz istniejace powiazania tego renderera z jakimikolwiek node'ami jakie dostawal gdzies w Prepare i z aktualnym kontekstem OpenGL'a. Nie zrobi nic jezeli takich powiazan nie bylo (np. jesli wywolales | |
![]() |
procedure RenderBegin(FogNode: TNodeFog; const FogDistanceScaling: Single); |
![]() |
procedure RenderEnd; |
![]() |
procedure RenderShapeStateBegin(Node: TNodeGeneralShape; State: TVRMLGraphTraverseState); |
![]() |
procedure RenderShapeStateNoTransform(Node: TNodeGeneralShape; State: TVRMLGraphTraverseState); |
![]() |
procedure RenderShapeStateEnd(Node: TNodeGeneralShape; State: TVRMLGraphTraverseState); |
![]() |
procedure RenderShapeState(Node: TNodeGeneralShape; State: TVRMLGraphTraverseState); |
![]() |
function BumpMappingMethod: TBumpMappingMethod; |
|
This checks Attributes (mainly Attributes.BumpMappingMaximum) and OpenGL context capabilities to check which bump mapping method (if any) should be used. More precisely: this checks Attributes.BumpMappingMaximum, Attributes.EnableTextures. Then checks are appropriate OpenGL capabilities present (GL_ARB_multitexture and friends, GLSL for better methods). Then checks are enough texture units available (using First/LastGLFreeTexture). This method is mainly for debugging purposes, as this class handles everything related to bump mapping inside. This function may be usable for you only to display to user this property. Note that calling this ties us to current OpenGL context (just like any PrepareXxx or RenderXxx call). | |
![]() |
class function GLContextBumpMappingMethod( const FirstGLFreeTexture: Cardinal; ALastGLFreeTexture: Integer; const AttributesBumpMappingMaximum: TBumpMappingMethod; const AttributesEnableTextures, AttributesPureGeometry: boolean): TBumpMappingMethod; |
|
How we would support bump mapping in current OpenGL context, with given Attributes values. The contract is that if you create TVRMLOpenGLRenderer in current OpenGL context and set it's Attributes just like parameters to this method then created TVRMLOpenGLRenderer will have BumpMappingMethod the same as what this function tells. This is helpful if you don't have TVRMLOpenGLRenderer and it's attributes instances created yet, but you want to know right now what bump mapping will be available. | |
![]() |
property Attributes: TVRMLRenderingAttributes read FAttributes; |
|
slowo o atrybutach renderowania ktore steruja tym jak bedzie wygladac renderowanie : mozesz je zmieniac tylko w momencie gdy renderer nie jest przywiazany do zadnego kontekstu OpenGL'a (co jest zwiazane z tym ze przywiazanie do danego kontekstu OpenGL'a oznacza takze ze czesc pracy z dostosowaniem sie do takich a nie innych atrybutow renderowania zostala juz zrobiona) czyli zaraz po wywolaniu konstruktora lub UnprepareAll (przed wywolaniem jakiegokolwiek Prepare czy Render*). | |
![]() |
property Cache: TVRMLOpenGLRendererContextCache read FCache; |
![]() |
property BumpMappingLightPosition: TVector3Single
read FBumpMappingLightPosition write SetBumpMappingLightPosition; |
|
Sets light position used for bump mapping. This is meaningful if BumpMappingMethod <> bmNone. If BumpMappingMethod is in bmMultiTexAll, then this simply sets internal variable. You have to actually render model (that is, call RenderBegin + RenderShapeState...) to use new If BumpMappingMethod is in bmGLSLAll, things are better. If the bump mapping shader is already prepared, then setting this property simply sets the uniform value of this shader. And light direction in tangent space is calculated by the shader. So you can simply reuse your display lists. (If the bump mapping shader is not prepared yet, then value set here will be used at preparation... so things work without problems in any case.) | |
![]() |
property BumpMappingLightAmbientColor: TVector4Single
read FBumpMappingLightAmbientColor
write SetBumpMappingLightAmbientColor; |
|
Ambient color of the light calculated when doing bump mapping. When doing bump mapping, we don't use VRML lights. Instead some properties of the light are controlled by BumpMappingLightPosition (or TVRMLFlatSceneGL.BumpMappingLightPosition) and attributes like this one. Note that whether this is used depends on BumpMappingMethod used (and this depends on OpenGL capabilities). Some bump mapping methods may not be able to use this. For now, this is used only by bmGLSLAll methods. Default value is DefaultBumpMappingLightAmbientColor. 4th component of the color has the same meaning and use as 4th color component for OpenGL lights. Usually, just set this to 1.0. | |
![]() |
property BumpMappingLightDiffuseColor: TVector4Single
read FBumpMappingLightDiffuseColor
write SetBumpMappingLightDiffuseColor; |
|
Diffuse color of the light calculated when doing bump mapping. See also comments at BumpMappingLightAmbientColor. Default value is DefaultBumpMappingLightDiffuseColor. | |