-
First, thank you so much for making this Malt engine. I find myself getting more used to code based texture now. HAHA I have one question. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hi! I'm glad that Malt is helping you to get into shader coding. :) For grouping variables, you can use structs. For example: #include "Pipelines/NPR_Pipeline.glsl"
struct TextureSettings
{
sampler2D texture;
int uv_index;
};
uniform TextureSettings Color_Texture;
void COMMON_PIXEL_SHADER(Surface S, inout PixelOutput PO)
{
PO.color = texture(Color_Texture.texture, UV[Color_Texture.uv_index]);
} Alternatively, you can also use #include "Pipelines/NPR_Pipeline.glsl"
uniform sampler2D Color_Texture_0_texture;
uniform int Color_Texture_0_uv_index;
void COMMON_PIXEL_SHADER(Surface S, inout PixelOutput PO)
{
PO.color = texture(Color_Texture_0_texture, UV[Color_Texture_0_uv_index]);
} Both of these samples will look the same in the UI. |
Beta Was this translation helpful? Give feedback.
-
May I ask, How to make group with node? |
Beta Was this translation helpful? Give feedback.
Hi! I'm glad that Malt is helping you to get into shader coding. :)
For grouping variables, you can use structs. For example:
Alternatively, you can also use
_0_
as a separator in the variable name.