Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
textures [2020/01/12 21:30] – [Wrapping] admin | textures [2020/05/25 12:28] – [Example] admin | ||
---|---|---|---|
Line 57: | Line 57: | ||
|TGorillaTextureWrap.MirrorRepeated|| | |TGorillaTextureWrap.MirrorRepeated|| | ||
+ | ===== Setting up ===== | ||
+ | |||
+ | To set up a Gorilla3D texture correctly, you need to encapsulate property configuration inside of BeginSetup and EndSetup method. | ||
+ | Only then all settings will correctly be submitted to OpenGL. | ||
===== Example ===== | ===== Example ===== | ||
+ | |||
+ | At first a simple example where a TGorillaTextureBitmap is created with a size of 1024 x 1024 pixels and will all necessary settings. | ||
+ | |||
+ | <file pascal> | ||
+ | LTexture := TGorillaTextureBitmap.Create(1024, | ||
+ | LTexture.BeginSetup(); | ||
+ | try | ||
+ | with LTexture do | ||
+ | begin | ||
+ | Components := TPixelFormatEx.RGB32F; | ||
+ | Format := TPixelFormatEx.RGB; | ||
+ | MinFilter := TTextureFilter.Linear; | ||
+ | MagFilter := TTextureFilter.Linear; | ||
+ | WrapS := TGorillaTextureWrap.ClampToBorder; | ||
+ | WrapT := TGorillaTextureWrap.ClampToBorder; | ||
+ | end; | ||
+ | finally | ||
+ | LTexture.EndSetup(); | ||
+ | end; | ||
+ | </ | ||
+ | |||
+ | Secondly a common example to ignore linear interpolation of a material texture. This becomes very useful, when displaying textures in pixelart, like minecraft. | ||
+ | |||
+ | We have to disable interpolation an mipmapping. | ||
<file pascal> | <file pascal> |