Add noise support.

This commit is contained in:
Dario 2021-04-27 19:04:28 -03:00
parent c7d84406f9
commit 93c363f89f
2 changed files with 3 additions and 4 deletions

View File

@ -126,12 +126,10 @@ typedef struct {
int opt_alpha;
int opt_fog;
int opt_texture_edge;
int opt_noise;
// Flag containing all attributes that are actually used by this material.
int enabledAttributes;
// Add padding to line up with the HLSL structure.
int _padB;
} RT64_MATERIAL;
// Light

View File

@ -903,6 +903,7 @@ static void gfx_rt64_wapi_init(const char *window_title) {
RT64.defaultMaterial.opt_alpha = 0;
RT64.defaultMaterial.opt_fog = 1;
RT64.defaultMaterial.opt_texture_edge = 0;
RT64.defaultMaterial.opt_noise = 0;
// Initialize the global lights to their default values.
memset(RT64.levelLights, 0, sizeof(RT64.levelLights));
@ -1293,7 +1294,7 @@ RT64_MATERIAL gfx_rt64_rapi_build_material(ShaderProgram *prg, bool linearFilter
mat.opt_alpha = (shader_id & SHADER_OPT_ALPHA) != 0;
mat.opt_fog = (shader_id & SHADER_OPT_FOG) != 0;
mat.opt_texture_edge = (shader_id & SHADER_OPT_TEXTURE_EDGE) != 0;
//mat.opt_noise = (shader_id & SHADER_OPT_NOISE) != 0;
mat.opt_noise = (shader_id & SHADER_OPT_NOISE) != 0;
return mat;
}