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:00] – [Properties] admin | 1.0.0:default-material [2023/04/17 08:59] (current) – [Adding new Textures at DesignTime] admin | ||
---|---|---|---|
Line 239: | Line 239: | ||
* LOCALS.**Diffuse** | * LOCALS.**Diffuse** | ||
* LOCALS.**Specular** | * LOCALS.**Specular** | ||
+ | * LOCALS.**Emissive** | ||
* LOCALS.**TexCoord0** | * LOCALS.**TexCoord0** | ||
+ | * LOCALS.**TexCoord1** | ||
+ | * LOCALS.**TexCoord2** | ||
+ | * LOCALS.**TexCoord3** | ||
* LOCALS.**TransfVertPos** | * LOCALS.**TransfVertPos** | ||
+ | * LOCALS.**FragDepth** | ||
* LOCALS.**Normal** | * LOCALS.**Normal** | ||
* LOCALS.**FragViewDir** | * LOCALS.**FragViewDir** | ||
Line 348: | Line 353: | ||
| - | TGorillaGLSLClippingPlaneGetNode| Sets the locals value for **LOCALS.ClippingPlane**. | | | - | TGorillaGLSLClippingPlaneGetNode| Sets the locals value for **LOCALS.ClippingPlane**. | | ||
| - | TGorillaGLSLVertexShaderOutputNode| Automatically sets the following locals and varying parameters< | | - | TGorillaGLSLVertexShaderOutputNode| Automatically sets the following locals and varying parameters< | ||
+ | * **LOCALS.Position** | ||
* **LOCALS.TransfVertexPos** | * **LOCALS.TransfVertexPos** | ||
* **LOCALS.WorldViewProjVertPos** | * **LOCALS.WorldViewProjVertPos** | ||
* **LOCALS.TexCoord0** | * **LOCALS.TexCoord0** | ||
+ | * **LOCALS.TexCoord1** | ||
+ | * **LOCALS.TexCoord2** | ||
+ | * **LOCALS.TexCoord3** | ||
* **LOCALS.Color0** | * **LOCALS.Color0** | ||
* **LOCALS.Normal** | * **LOCALS.Normal** | ||
* **LOCALS.Tangent** | * **LOCALS.Tangent** | ||
* **LOCALS.Binormal** | * **LOCALS.Binormal** | ||
+ | * **LOCALS.Displace** | ||
+ | * **LOCALS.ClippingPlane** | ||
* **vars.v_TBN** | * **vars.v_TBN** | ||
* **vars.v_TBN_UT** | * **vars.v_TBN_UT** | ||
Line 965: | Line 976: | ||
| _NormalMapTexture | FragmentShader | sampler2D | If GORILLA_GLSL_DEFINE_NORMALMAP is activated. | | | _NormalMapTexture | FragmentShader | sampler2D | If GORILLA_GLSL_DEFINE_NORMALMAP is activated. | | ||
| _SpecularMapTexture | FragmentShader | sampler2D | If GORILLA_GLSL_DEFINE_USE_SPECULAR is activated. | | | _SpecularMapTexture | FragmentShader | sampler2D | If GORILLA_GLSL_DEFINE_USE_SPECULAR is activated. | | ||
+ | | _EmissiveTexture | FragmentShader | sampler2D | If GORILLA_GLSL_DEFINE_USE_EMISSIVE is activated. | | ||
| _DepthTexture | FragmentShader | sampler2D | If GORILLA_GLSL_DEFINE_DEPTH is activated. | | | _DepthTexture | FragmentShader | sampler2D | If GORILLA_GLSL_DEFINE_DEPTH is activated. | | ||
| _EnvironmentTexture | FragmentShader | samplerCube | If GORILLA_GLSL_DEFINE_ENVIRONMENT is activated. | | | _EnvironmentTexture | FragmentShader | samplerCube | If GORILLA_GLSL_DEFINE_ENVIRONMENT is activated. | | ||
Line 1009: | Line 1021: | ||
</ | </ | ||
- | **__NOTICE: | + | **__NOTICE: |
===== Extending the default material ===== | ===== Extending the default material ===== | ||
Line 1454: | Line 1466: | ||
</ | </ | ||
+ | Read more about TLocals structure in VertexShader/ | ||
+ | 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| |