-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--[[ | ||
Copyright (C) 2024 Silverlan | ||
This Source Code Form is subject to the terms of the Mozilla Public | ||
License, v. 2.0. If a copy of the MPL was not distributed with this | ||
file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
]] | ||
|
||
include("/shaders/bw/shader.lua") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--[[ | ||
Copyright (C) 2024 Silverlan | ||
This Source Code Form is subject to the terms of the Mozilla Public | ||
License, v. 2.0. If a copy of the MPL was not distributed with this | ||
file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
]] | ||
|
||
local Shader = util.register_class("shader.BwShader", shader.BasePbr) | ||
|
||
Shader.FragmentShader = "programs/scene/bw" | ||
Shader.VertexShader = "programs/scene/textured" | ||
function Shader:InitializePipeline(pipelineInfo, pipelineIdx) | ||
shader.BasePbr.InitializePipeline(self, pipelineInfo, pipelineIdx) | ||
end | ||
shader.register("bw", Shader) |
1 change: 1 addition & 0 deletions
1
assets/addons/bw_shader/scripts/localization/en/texts/bw_shader.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
c_bw = "Black and White" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#version 440 | ||
|
||
#extension GL_ARB_separate_shader_objects : enable | ||
#extension GL_ARB_shading_language_420pack : enable | ||
|
||
#include "/programs/scene/pbr/fs_core.glsl" | ||
|
||
void main() | ||
{ | ||
vec2 uv = get_uv_coordinates(); | ||
vec4 albedoColor = fetch_albedo_map(uv, get_instance_color()); | ||
fs_color = calc_pbr(albedoColor, uv, u_pushConstants.debugMode); | ||
float luminance = calc_luminance(fs_color.rgb); | ||
fs_color.rgb = vec3(luminance, luminance, luminance); | ||
if(CSPEC_BLOOM_OUTPUT_ENABLED == 1) | ||
extract_bright_color(fs_color, u_renderer.bloomThreshold); | ||
} |