Skip to content

Commit

Permalink
sample_diffusemap
Browse files Browse the repository at this point in the history
  • Loading branch information
jdolan committed Mar 23, 2024
1 parent fface70 commit 9ef94e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/client/renderer/shaders/bsp_fs.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ struct fragment_t {
/**
* @brief
*/
vec4 sample_material() {
return pow(texture(texture_material, vec3(vertex.diffusemap, 0)), vec4(vec3(gamma), 1.0));
vec4 sample_diffusemap() {
return pow(texture(texture_material, vec3(vertex.diffusemap, 0)), vec4(vec3(1.0 / gamma), 1.0));
}

/**
Expand Down Expand Up @@ -454,7 +454,7 @@ void main(void) {

if ((stage.flags & STAGE_MATERIAL) == STAGE_MATERIAL) {

fragment.diffusemap = sample_material() * vertex.color;
fragment.diffusemap = sample_diffusemap() * vertex.color;

if (fragment.diffusemap.a < material.alpha_test) {
discard;
Expand Down
4 changes: 2 additions & 2 deletions src/client/renderer/shaders/mesh_fs.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ uniform vec4 tint_colors[3];
/**
* @brief
*/
vec4 sample_material() {
vec4 sample_diffusemap() {
return pow(texture(texture_material, vec3(vertex.diffusemap, 0)), vec4(vec3(gamma), 1.0));
}

Expand Down Expand Up @@ -379,7 +379,7 @@ void main(void) {

if ((stage.flags & STAGE_MATERIAL) == STAGE_MATERIAL) {

fragment.diffusemap = sample_material() * vertex.color * color;
fragment.diffusemap = sample_diffusemap() * vertex.color * color;

if (fragment.diffusemap.a < material.alpha_test) {
discard;
Expand Down

0 comments on commit 9ef94e5

Please sign in to comment.