-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upgrade framework, upgrade shaders to new spir-v #321
Conversation
@WebFreak001 Thanks for your contribution! You saved my time 🎉 |
I noticed some shader code in the tests which I didn't upgrade yet. Gonna sleep for now, maybe gonna look at it tomorrow |
And notice that i might open another PR(#322) because uniform in the shader might designed like this: // see the demo: https://www.geeks3d.com/20101029/shader-library-pixelation-post-processing-effect-glsl/
#include "sh_Utils.h"
layout(location = 2) in mediump vec2 v_TexCoord;
// will pass the value in the CustomizedShaderBufferedDrawNode
layout(std140, set = 0, binding = 0) uniform m_SharedParameters
{
mediump vec2 g_TexSize;
float g_InflationPercentage;
};
// will pass the value in the customized shader. might have the same name for every shader? not very sure
layout(std140, set = 2, binding = 0) uniform m_PixelParameters
{
mediump vec2 g_Size;
};
layout(set = 1, binding = 0) uniform lowp texture2D m_Texture;
layout(set = 1, binding = 1) uniform lowp sampler m_Sampler;
layout(location = 0) out vec4 o_Colour;
void main(void)
{
vec2 separaorParts = g_TexSize / (g_Size * g_InflationPercentage);
vec2 uv = v_TexCoord;
uv = uv * separaorParts;
uv = floor(uv);
uv = uv / separaorParts;
o_Colour = toSRGB(texture(sampler2D(m_Texture, m_Sampler), uv));
} |
@WebFreak001 close this issue because create another PR for the minimum required change only. |
public float Mix { get; set; } = 1f; | ||
|
||
public override void ApplyValue() | ||
{ | ||
if (Texture == null) | ||
return; | ||
|
||
// where this 1 is from? I have no clue. | ||
Texture.Bind(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: I tested these things on top of #320
I haven't tried if all shaders work though, I don't know how to run the visual tests.