mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-07 23:16:02 +00:00
Plain color fragment shader - Update uniform names to be PascalCase
This commit is contained in:
@@ -261,8 +261,8 @@ namespace PckStudio.Rendering
|
||||
Matrix4 viewProjection = Camera.GetViewProjection();
|
||||
colorShader.SetUniformMat4("ViewProjection", ref viewProjection);
|
||||
colorShader.SetUniformMat4("Transform", ref transform);
|
||||
colorShader.SetUniform4("baseColor", color);
|
||||
colorShader.SetUniform1("intensity", 0.6f);
|
||||
colorShader.SetUniform4("BlendColor", color);
|
||||
colorShader.SetUniform1("Intensity", 0.6f);
|
||||
|
||||
GL.Enable(EnableCap.LineSmooth);
|
||||
|
||||
@@ -540,8 +540,8 @@ namespace PckStudio.Rendering
|
||||
{
|
||||
Matrix4 transform = Matrix4.CreateTranslation(Camera.FocalPoint).Inverted();
|
||||
colorShader.SetUniformMat4("Transform", ref transform);
|
||||
colorShader.SetUniform1("intensity", 0.75f);
|
||||
colorShader.SetUniform4("baseColor", Color.DeepPink);
|
||||
colorShader.SetUniform1("Intensity", 0.75f);
|
||||
colorShader.SetUniform4("BlendColor", Color.DeepPink);
|
||||
GL.PointSize(5f);
|
||||
Renderer.Draw(colorShader, d_debugPointDrawContext);
|
||||
GL.PointSize(1f);
|
||||
@@ -553,8 +553,8 @@ namespace PckStudio.Rendering
|
||||
transform *= Matrix4.CreateScale(Camera.Distance / 4f).Inverted();
|
||||
transform.Invert();
|
||||
colorShader.SetUniformMat4("Transform", ref transform);
|
||||
colorShader.SetUniform1("intensity", 0.75f);
|
||||
colorShader.SetUniform4("baseColor", Color.White);
|
||||
colorShader.SetUniform1("Intensity", 0.75f);
|
||||
colorShader.SetUniform4("BlendColor", Color.White);
|
||||
|
||||
Renderer.SetLineWidth(2f);
|
||||
|
||||
|
||||
@@ -490,8 +490,8 @@ namespace PckStudio.Rendering
|
||||
{
|
||||
var lineShader = ShaderProgram.Create(Resources.plainColorVertexShader, Resources.plainColorFragmentShader);
|
||||
lineShader.Bind();
|
||||
lineShader.SetUniform4("baseColor", Color.WhiteSmoke);
|
||||
lineShader.SetUniform1("intensity", 0.5f);
|
||||
lineShader.SetUniform4("BlendColor", Color.WhiteSmoke);
|
||||
lineShader.SetUniform1("Intensity", 0.5f);
|
||||
lineShader.Validate();
|
||||
AddShader("PlainColorShader", lineShader);
|
||||
|
||||
@@ -950,8 +950,8 @@ namespace PckStudio.Rendering
|
||||
lineShader.Bind();
|
||||
lineShader.SetUniformMat4("ViewProjection", ref viewProjection);
|
||||
lineShader.SetUniformMat4("Transform", ref transform);
|
||||
lineShader.SetUniform1("intensity", 1f);
|
||||
lineShader.SetUniform4("baseColor", GuideLineColor);
|
||||
lineShader.SetUniform1("Intensity", 1f);
|
||||
lineShader.SetUniform4("BlendColor", GuideLineColor);
|
||||
Renderer.SetLineWidth(2.5f);
|
||||
Renderer.Draw(lineShader, GetGuidelineDrawContext());
|
||||
Renderer.SetLineWidth(1f);
|
||||
@@ -1007,8 +1007,8 @@ namespace PckStudio.Rendering
|
||||
GL.BlendFunc(BlendingFactor.DstAlpha, BlendingFactor.OneMinusSrcAlpha);
|
||||
lineShader.Bind();
|
||||
lineShader.SetUniformMat4("ViewProjection", ref viewProjection);
|
||||
lineShader.SetUniform1("intensity", 0.5f);
|
||||
lineShader.SetUniform4("baseColor", Color.AntiqueWhite);
|
||||
lineShader.SetUniform1("Intensity", 0.5f);
|
||||
lineShader.SetUniform4("BlendColor", Color.AntiqueWhite);
|
||||
Matrix4 transform = Matrix4.CreateScale(25f) * Matrix4.CreateTranslation(new Vector3(0f, -24.1f, 0f));
|
||||
lineShader.SetUniformMat4("Transform", ref transform);
|
||||
Renderer.Draw(lineShader, _groundDrawContext);
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
layout(location = 0) out vec4 FragColor;
|
||||
|
||||
uniform vec4 baseColor;
|
||||
uniform float intensity;
|
||||
uniform vec4 BlendColor;
|
||||
uniform float Intensity;
|
||||
|
||||
in vec4 color;
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = vec4((color * baseColor).rgb, intensity);
|
||||
FragColor = vec4((color * BlendColor).rgb, Intensity);
|
||||
}
|
||||
Reference in New Issue
Block a user