-
Notifications
You must be signed in to change notification settings - Fork 226
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
WebGL x regl different results #62
Comments
The parameters passed into them are the same, but the bloomBlur.wgsl and bloomPass.blur.frag.glsl have the same responsibilities but I don't think their kernels are even the same size. bloomCombine.wgsl and bloomPass.combine.frag.glsl are also quite different. I might even have different size image pyramids in here. Either of those large differences would be reason enough for the blur to look different between my two renderers. One other theory, though, is that the WebGPU bloom pass may be setting a different base resolution than the From the perspective of a Unity port, I would suggest that you go with your gut when implementing the bloom. My As for the symbol brightness shader code you mention, that's almost verbatim MSDF rendering stuff. void main() {
// Bilinear sampling of the distance field
vec3 s = texture2D(sdf, P).rgb;
// Acquiring the signed distance
float d = median(s.r, s.g, s.b) - 0.5;
// The anti-aliased measure of how "inside" the fragment lies
float w = clamp(d/fwidth(d) + 0.5, 0.0, 1.0);
// Combining the two colors
gl_FragColor = mix(outsideColor, insideColor, w);
} —that's from Viktor Chlumsky's master's thesis. It's a fun one to skim. A-Frame's got it in theirs, too, so if your wife is using her laptop for something important, this particular tree probably isn't worth barking up just yet. 😉 |
Yeah, I noticed that too. I also adjusted the WebGL code to have a similar behavior to the
If this is the case, reducing the
🚀
I was reading his master's thesis yesterday to try to understand my problem with Unity. I'm sure it's related to float precision since I'm not able to control it that well on HLSL, like define a global precision as you did on GLSL. I'm not familiar with Unity, and most of the big problems that I had I solved by changing a Unity option 🤦♂️ |
Circling back to the problem, I tried the solution that I used on Unity, but it didn't help. It just reduced the antialias, but I still have a blur in the font using webgpu renderer. When I have more time, I will return to find the root of this problem and submit a PR. I finished the Unity port for the 2D version of the shader and a simple tri-planar mapping strategy for the same texture, but using the same 2D texture strategy for 3D doesn't generate a seamless effect. Now, I'm adapting the code for something more in this line: https://github.com/IRCSS/MatrixVFX/tree/master?tab=readme-ov-file I'm happy with the results so far. Thank you again for your work and for sharing valuable tips and resources 🙏 |
Thank you Jeremy for this amazing work!
I found this project a few years ago. Finally, last week, I started my journey to adapt your matrix rain as Vivaldi background start page, as I did before with a simpler matrix rain, and then adapt the shader for Unity so we can have something like the Apple Vision Pro matrix effect.
On the Vivaldi browser adaptation, my first problem was a CORS related policy on Vivaldi that prevented
regl
from compiling the shaders. So I switched towebGL
and noticed a huge difference in the bloom effect on my computer:Investigating the bloom shader, I noticed a slightly different implementation from the
regl
shader, but even matching the shader code and decreasing thebloomStrength
value, I didn't get the crisp text as inregl
variant. So, testing the animation without the bloom effect, I noticed yesterday thatwebgl
animation has a blur in the text:I will investigate this blur today, but I decided to bring this issue up to see if you know what can be the cause of this issue.
Thanks for sharing this amazing matrix effect! 🫂
The text was updated successfully, but these errors were encountered: