Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
1.0.0:default-material [2023/02/27 16:10] – [Changing Shaders at DesignTime] admin | 1.0.0:default-material [2023/04/17 08:59] (current) – [Adding new Textures at DesignTime] admin | ||
---|---|---|---|
Line 1466: | Line 1466: | ||
</ | </ | ||
- | Read more about TLocals structure in VertexShader/ | + | Read more about TLocals structure in VertexShader/ |
at // | at // | ||
+ | |||
+ | ==== Adding new Textures at DesignTime ==== | ||
+ | |||
+ | Besides the possibility of adding textures by code at runtime, you can also add new textures at designtime. | ||
+ | |||
+ | Move inside the object inspector to the specific material source (inherited from TGorillaDefaultMaterialSource). | ||
+ | |||
+ | __Steps:__ | ||
+ | * Open the design editor of the " | ||
+ | * Add a new item | ||
+ | * Input a name for the texture | ||
+ | * Choose where the texture will be available: PixelShader or VertexShader | ||
+ | |||
+ | __// | ||
+ | |||
+ | Due to Firemonkey implementation, | ||
+ | access it by " | ||
+ | |||
+ | When you choose the shader your texture will be available, you can access it also at design time in the corresponding property: | ||
+ | |||
+ | ^ShaderKind^Property^ | ||
+ | |PixelShader|< | ||
+ | |VertexShader|< | ||
+ | |||
+ | |||
+ | In the collection item you can configure further properties of your texture and you can of course load the image data itself. | ||
+ | |||
+ | __// | ||
+ | |||
+ | __// | ||
+ | |||
+ | === Availabled Properties === | ||
+ | |||
+ | ^Property^Descr^ | ||
+ | |Bitmap|Image data loadable from BMP, PNG or JPEG| | ||
+ | |BorderColor|Defines a texture border color.| | ||
+ | |DataType|Defines the data type of the internal texture format. See OpenGL specification for further information.| | ||
+ | |Format|Defines the general texture format. See OpenGL specification for further information.| | ||
+ | |IgnoreInArray|Internally arrays of textures are used for specific topics (shadows), where the name of the texture becomes obsolete.| | ||
+ | |InternalFormat|Defines the internal texture format. See OpenGL specification for further information.| | ||
+ | |IsDynamic|The texture will automatically retrieve its image data from a renderpass or other dynamic source. It's not recommended to use this with user specific textures.| | ||
+ | |MagFilter|Defines the magnification texture filtering in combination with the MinFilter property.| | ||
+ | |MinFilter|Defines the minification texture filtering in combination with the MagFilter property.| | ||
+ | |Name|A name for the texture will always be needed! Access the texture in shaders with the prefix " | ||
+ | |ProtoectFormatSettings|TRUE/ | ||
+ | |ShaderKind|Defines where the texture will be available. In PixelShader or VertexShader.| | ||
+ | |TextureKind|Kind of the texture: 2D, 3D, CubeMap, 2DArray (**recommened: | ||
+ | |TilingX|Tiling of the texture on x-axis (2D)| | ||
+ | |TilingY|Tiling of the texture on y-axis (2D)| | ||
+ | |WrapR|Texture wrapping on R-axis (for 3D textures)| | ||
+ | |WrapS|Texture wrapping on S-axis| | ||
+ | |WrapT|Texture wrapping on T-axis| |