mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
Emphasize the importance of mipmaps for textureLod() in Screen-reading shaders
This also mentions that reading the normal/roughness buffer is only currently supported in Forward+.
This commit is contained in:
@@ -40,8 +40,9 @@ Your scene tree will look something like this:
|
||||
|
||||
As of the time of writing, Godot does not support rendering to multiple
|
||||
buffers at the same time. Your post-processing shader will not have access
|
||||
to normals or other render passes. You only have access to the rendered
|
||||
frame.
|
||||
to other render passes and buffers not exposed by Godot (such as depth or
|
||||
normal/roughness). You only have access to the rendered frame and buffers
|
||||
exposed by Godot as samplers.
|
||||
|
||||
For this demo, we will use this :ref:`Sprite <class_Sprite2D>` of a sheep.
|
||||
|
||||
@@ -60,6 +61,8 @@ shader by `arlez80 <https://bitbucket.org/arlez80/hex-mosaic/src/master/>`_,
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform vec2 size = vec2(32.0, 28.0);
|
||||
// If you intend to read from mipmaps with `textureLod()` LOD values greater than `0.0`,
|
||||
// use `filter_nearest_mipmap` instead. This shader doesn't require it.
|
||||
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
|
||||
|
||||
void fragment() {
|
||||
|
||||
Reference in New Issue
Block a user