Godot Version
v4.2.stable.official [46dc27791]
Question
I’m trying to create a blur effect using the SCREEN TEXTURE , since the new syntax was implemented to this – > (uniform sampler2D SCREEN_TEXTURE: hint_screen_texture ,) stop working on web , however it works fine on the engine.
I’ve even find different solutions for the blur, like a Gaussian algorithm for the GLES2, although it kills my performance
1 Like
I’ve tried a different shader, the example from Godot documentation, however I used the saturation shader (SCREEN TEXTURE EXAMPLE ), which uses the same line for the blur,
vec3 c = textureLod(screen_texture, SCREEN_UV, 0.0).rgb;
and it works fine when deploying for web, just the blur shader is not working…
mrcdk
January 31, 2024, 4:45pm
3
Check the documentation about screen reading shaders Screen-reading shaders — Godot Engine (stable) documentation in English it’s explained there what you need to do to get textureLod()
working correctly.
1 Like
I’ve checked it, it works fine for me inside the engine, that just doesn’t work when I try it on web
There is an open github issue for this. According to the thread, it seems this issue regressed between versions 4.1 and 4.2.
opened 03:36PM - 08 May 24 UTC
bug
platform:web
topic:rendering
### Tested versions
Tested in Godot **v4.2.1.stable.official** and **v4.3.dev6.… official**
### System information
Godot v4.2.1.stable - Pop!_OS 22.04 LTS - X11 - Vulkan (Mobile) - integrated AMD Radeon Vega 8 Graphics (RADV RAVEN) () - AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx (8 Threads)
### Issue description
*DISCLAIMER: I'm a shader noob.*
Blur shader works in editor but not in web export.
```shader
shader_type canvas_item;
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, repeat_enable, filter_linear_mipmap;
uniform float lod: hint_range(0.0, 5.0) = 1.5;
void fragment(){
vec4 color = textureLod(SCREEN_TEXTURE, SCREEN_UV, lod);
COLOR = color;
}
```
This is how it looks in editor -also when I click play-

This is how it looks both in Firefox 125.0.2 (64-bit) and Chrome 124.0.6367.155 (64-bit)

Firefox errors with:
```
WebGL warning: drawArraysInstanced: Framebuffer not complete. (status: 0x8cd6) COLOR_ATTACHMENT0: Attached mip level is invalid for texture.
```
And Chrome with:
```
[.WebGL-0x2e14101d7f00] GL_INVALID_FRAMEBUFFER_OPERATION: Framebuffer is incomplete: Attachment level is not in the [base level, max level] range.
```
I also tested with a TextureRect instead of a ColorRect, attached a 2048x2048 white-filled texture, tried reimporting the texture with different compression modes and mipmaps enabled, nothing changed.
### Steps to reproduce
Run provided MRP.
### Minimal reproduction project (MRP)
[webgl_blur_shader.zip](https://github.com/godotengine/godot/files/15251087/webgl_blur_shader.zip)
Please share if you found a work around, my web export project is in trouble because of this bug.