Switching to fully guarded memory allocator. Blender 2.83 (sub 11) Build: 2020-03-25 07:02:46 Windows Release argv[0] = blender argv[1] = --debug argv[2] = --debug-gpu argv[3] = --python-expr argv[4] = import bpy; bpy.ops.wm.sysinfo(filepath=r'C:\Users\ADMINI~1\AppData\Local\Temp\blender\debug_logs\blender_system_info.txt') Read prefs: Z:\Users\Z\AppData\Roaming\Blender Foundation\Blender\2.83\config\userpref.blend read file Z:\Users\Z\AppData\Roaming\Blender Foundation\Blender\2.83\config\startup.blend Version 282 sub 7 date 2020-02-12 16:20 hash 77d23b0bd76f AL lib: (EE) UpdateDeviceParams: Failed to set 48000hz, got 44100hz instead GPUTexture: create : TEXTURE_CUBE_MAP, RGBA16F, w : 2, h : 2, d : 0, comp : 4, size : 0.00 MiB GPUTexture: create : TEXTURE_1D, RGBA8, w : 1, h : 0, d : 0, comp : 4, size : 0.00 MiB GPUTexture: create : TEXTURE_2D, RGBA8, w : 1, h : 1, d : 0, comp : 4, size : 0.00 MiB GPUTexture: create : TEXTURE_3D, RGBA8, w : 1, h : 1, d : 1, comp : 4, size : 0.00 MiB Using OpenGL 4.3 debug facilities GL application marker: Successfully hooked OpenGL debug callback. found bundled python: E:\dev\cmake-build\bin\Release\2.83\python INFO: Could not find files for the given pattern(s). GPUTexture: create : TEXTURE_2D, RGBA8, w : 2055, h : 32, d : 0, comp : 4, size : 0.25 MiB GPUTexture: create : TEXTURE_1D_ARRAY, R8, w : 16384, h : 1, d : 0, comp : 1, size : 0.02 MiB GL API other: Buffer detailed info: Buffer object 2 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 4 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) will use SYSTEM HEAP memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GPUTexture: create : TEXTURE_2D, RGBA8, w : 505, h : 32, d : 0, comp : 4, size : 0.06 MiB GL API other: Buffer detailed info: Buffer object 5 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GPUTexture: create : TEXTURE_2D, RGBA8, w : 2560, h : 1, d : 0, comp : 4, size : 0.01 MiB GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GPUTexture: create : TEXTURE_2D, RGBA8, w : 2560, h : 25, d : 0, comp : 4, size : 0.24 MiB GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GPUTexture: create : TEXTURE_2D, RGBA8, w : 36, h : 497, d : 0, comp : 4, size : 0.07 MiB GPUTexture: create : TEXTURE_2D, RGBA8, w : 379, h : 497, d : 0, comp : 4, size : 0.72 MiB GL API other: Texture state usage warning: Texture 0 is base level inconsistent. Check texture size. GL API performance: Program/shader state performance warning: Fragment Shader is going to be recompiled because the shader key based on GL state mismatches. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GPUTexture: create : TEXTURE_1D_ARRAY, R8, w : 16384, h : 1, d : 0, comp : 1, size : 0.02 MiB GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 6 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 7 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GPUTexture: create : TEXTURE_2D, RGBA8, w : 2144, h : 32, d : 0, comp : 4, size : 0.26 MiB GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GPUTexture: create : TEXTURE_2D, RGBA8, w : 2144, h : 108, d : 0, comp : 4, size : 0.88 MiB GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 8 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 9 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 10 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 11 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GPUTexture: create : TEXTURE_2D, RGBA8, w : 415, h : 32, d : 0, comp : 4, size : 0.05 MiB GPUTexture: create : TEXTURE_2D, RGBA8, w : 415, h : 239, d : 0, comp : 4, size : 0.38 MiB GL API other: Texture state usage warning: Texture 0 is base level inconsistent. Check texture size. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GPUTexture: create : TEXTURE_2D, RGBA8, w : 2144, h : 32, d : 0, comp : 4, size : 0.26 MiB GL API other: Texture state usage warning: Texture 0 is base level inconsistent. Check texture size. GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GPUTexture: create : TEXTURE_2D, RGBA8, w : 199, h : 1322, d : 0, comp : 4, size : 1.00 MiB GL API other: Buffer detailed info: Buffer object 12 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GPUTexture: create : TEXTURE_2D, RGBA8, w : 274, h : 1322, d : 0, comp : 4, size : 1.38 MiB GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 1 (bound to GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (0), GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB (1), and GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GL API other: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STREAM_DRAW) will use VIDEO memory as the source for buffer object operations. GL API other: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW) has been mapped WRITE_ONLY in SYSTEM HEAP memory (fast). GPUTexture: create : TEXTURE_2D, RGBA16F, w : 2144, h : 1354, d : 0, comp : 4, size : 44.30 MiB GPUTexture: create : TEXTURE_2D, (null), w : 2144, h : 1354, d : 0, comp : 4, size : 11.07 MiB GPUTexture: create : TEXTURE_2D, DEPTH24_STENCIL8, w : 2144, h : 1354, d : 0, comp : 1, size : 11.07 MiB GPUTexture: create : TEXTURE_1D, RGBA8, w : 257, h : 0, d : 0, comp : 4, size : 0.00 MiB GPUTexture: create : TEXTURE_1D, RGBA8, w : 256, h : 0, d : 0, comp : 4, size : 0.00 MiB GPUTexture: create : TEXTURE_2D, RGBA8, w : 1, h : 1, d : 0, comp : 4, size : 0.00 MiB GPUTexture: create : TEXTURE_2D, RGBA16F, w : 2144, h : 1354, d : 0, comp : 4, size : 44.30 MiB GPUTexture: create : TEXTURE_2D, RGBA32F, w : 2144, h : 1354, d : 0, comp : 2, size : 11.07 MiB GPUTexture: create : TEXTURE_3D, RGBA8, w : 1, h : 1, d : 1, comp : 4, size : 0.00 MiB GPUTexture: create : TEXTURE_3D, RGBA8, w : 1, h : 1, d : 1, comp : 4, size : 0.00 MiB GPUTexture: create : TEXTURE_1D, RGBA8, w : 1, h : 0, d : 0, comp : 4, size : 0.00 MiB GPUTexture: create : TEXTURE_2D, RGBA8, w : 1, h : 1, d : 0, comp : 4, size : 0.00 MiB GPUTexture: create : TEXTURE_2D, DEPTH_COMPONENT24, w : 1, h : 1, d : 0, comp : 1, size : 0.00 MiB GPUTexture: create : TEXTURE_2D, (null), w : 2144, h : 1354, d : 0, comp : 4, size : 11.07 MiB GPUTexture: create : TEXTURE_2D, RGBA8, w : 2144, h : 1354, d : 0, comp : 4, size : 11.07 MiB GPUTexture: create : TEXTURE_2D, DEPTH24_STENCIL8, w : 2144, h : 1354, d : 0, comp : 1, size : 11.07 MiB GPUTexture: create : TEXTURE_2D, R16UI, w : 2144, h : 1354, d : 0, comp : 1, size : 5.54 MiB GPUTexture: create : TEXTURE_2D, DEPTH24_STENCIL8, w : 2144, h : 1354, d : 0, comp : 1, size : 11.07 MiB GPUTexture: create : TEXTURE_2D, DEPTH24_STENCIL8, w : 2144, h : 1354, d : 0, comp : 1, size : 11.07 MiB GPUTexture: create : TEXTURE_2D, R11F_G11F_B10F, w : 2144, h : 1354, d : 0, comp : 3, size : 11.07 MiB GPUTexture: create : TEXTURE_2D, R11F_G11F_B10F, w : 2144, h : 1354, d : 0, comp : 3, size : 11.07 MiB GPUTexture: create : TEXTURE_2D, R8, w : 64, h : 16, d : 0, comp : 1, size : 0.00 MiB GPUTexture: create : TEXTURE_2D, RG8, w : 160, h : 560, d : 0, comp : 2, size : 0.17 MiB GPUTexture: create : TEXTURE_2D, RG8, w : 2144, h : 1354, d : 0, comp : 2, size : 5.54 MiB GPUTexture: create : TEXTURE_2D, RGBA8, w : 2144, h : 1354, d : 0, comp : 4, size : 11.07 MiB GPUShader: compile error: ===== shader string 1 ==== 1 #version 330 ===== shader string 2 ==== 2 #define GPU_VERTEX_SHADER ===== shader string 3 ==== 3 #extension GL_ARB_texture_gather: enable 4 #define GPU_ARB_texture_gather 5 #extension GL_ARB_texture_query_lod: enable 6 #extension GL_ARB_shader_draw_parameters : enable 7 #extension GL_ARB_texture_cube_map_array : enable 8 #define GPU_ARB_texture_cube_map_array ===== shader string 4 ==== 9 #define GPU_NVIDIA 10 #define OS_WIN 11 #define DFDX_SIGN 1.0 12 #define DFDY_SIGN 1.0 ===== shader string 5 ==== 13 #define SMAA_GLSL_3 14 #define SMAA_RT_METRICS viewportMetrics 15 #define SMAA_PRESET_HIGH 16 #define SMAA_LUMA_WEIGHT float4(1.0, 1.0, 1.0, 0.0) 17 #define SMAA_NO_DISCARD 18 #define SMAA_STAGE 0 ===== shader string 6 ==== 19 #define SMAA_INCLUDE_VS 1 20 #define SMAA_INCLUDE_PS 0 21 uniform vec4 viewportMetrics; 22 /** 23 * Copyright (C) 2013 Jorge Jimenez (jorge@iryoku.com) 24 * Copyright (C) 2013 Jose I. Echevarria (joseignacioechevarria@gmail.com) 25 * Copyright (C) 2013 Belen Masia (bmasia@unizar.es) 26 * Copyright (C) 2013 Fernando Navarro (fernandn@microsoft.com) 27 * Copyright (C) 2013 Diego Gutierrez (diegog@unizar.es) 28 * 29 * Permission is hereby granted, free of charge, to any person obtaining a copy 30 * this software and associated documentation files (the "Software"), to deal in 31 * the Software without restriction, including without limitation the rights to 32 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 33 * of the Software, and to permit persons to whom the Software is furnished to 34 * do so, subject to the following conditions: 35 * 36 * The above copyright notice and this permission notice shall be included in 37 * all copies or substantial portions of the Software. As clarification, there 38 * is no requirement that the copyright notice and permission be included in 39 * binary distributions of the Software. 40 * 41 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 42 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 43 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 44 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 45 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 46 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 47 * SOFTWARE. 48 */ 49 50 /** 51 * _______ ___ ___ ___ ___ 52 * / || \/ | / \ / \ 53 * | (---- | \ / | / ^ \ / ^ \ 54 * \ \ | |\/| | / /_\ \ / /_\ \ 55 * ----) | | | | | / _____ \ / _____ \ 56 * |_______/ |__| |__| /__/ \__\ /__/ \__\ 57 * 58 * E N H A N C E D 59 * S U B P I X E L M O R P H O L O G I C A L A N T I A L I A S I N G 60 * 61 * http://www.iryoku.com/smaa/ 62 * 63 * Hi, welcome aboard! 64 * 65 * Here you'll find instructions to get the shader up and running as fast as 66 * possible. 67 * 68 * IMPORTANTE NOTICE: when updating, remember to update both this file and the 69 * precomputed textures! They may change from version to version. 70 * 71 * The shader has three passes, chained together as follows: 72 * 73 * |input|------------------� 74 * v | 75 * [ SMAA*EdgeDetection ] | 76 * v | 77 * |edgesTex| | 78 * v | 79 * [ SMAABlendingWeightCalculation ] | 80 * v | 81 * |blendTex| | 82 * v | 83 * [ SMAANeighborhoodBlending ] <------� 84 * v 85 * |output| 86 * 87 * Note that each [pass] has its own vertex and pixel shader. Remember to use 88 * oversized triangles instead of quads to avoid overshading along the 89 * diagonal. 90 * 91 * You've three edge detection methods to choose from: luma, color or depth. 92 * They represent different quality/performance and anti-aliasing/sharpness 93 * tradeoffs, so our recommendation is for you to choose the one that best 94 * suits your particular scenario: 95 * 96 * - Depth edge detection is usually the fastest but it may miss some edges. 97 * 98 * - Luma edge detection is usually more expensive than depth edge detection, 99 * but catches visible edges that depth edge detection can miss. 100 * 101 * - Color edge detection is usually the most expensive one but catches 102 * chroma-only edges. 103 * 104 * For quickstarters: just use luma edge detection. 105 * 106 * The general advice is to not rush the integration process and ensure each 107 * step is done correctly (don't try to integrate SMAA T2x with predicated edge 108 * detection from the start!). Ok then, let's go! 109 * 110 * 1. The first step is to create two RGBA temporal render targets for holding 111 * |edgesTex| and |blendTex|. 112 * 113 * In DX10 or DX11, you can use a RG render target for the edges texture. 114 * In the case of NVIDIA GPUs, using RG render targets seems to actually be 115 * slower. 116 * 117 * On the Xbox 360, you can use the same render target for resolving both 118 * |edgesTex| and |blendTex|, as they aren't needed simultaneously. 119 * 120 * 2. Both temporal render targets |edgesTex| and |blendTex| must be cleared 121 * each frame. Do not forget to clear the alpha channel! 122 * 123 * 3. The next step is loading the two supporting precalculated textures, 124 * 'areaTex' and 'searchTex'. You'll find them in the 'Textures' folder as 125 * C++ headers, and also as regular DDS files. They'll be needed for the 126 * 'SMAABlendingWeightCalculation' pass. 127 * 128 * If you use the C++ headers, be sure to load them in the format specified 129 * inside of them. 130 * 131 * You can also compress 'areaTex' and 'searchTex' using BC5 and BC4 132 * respectively, if you have that option in your content processor pipeline. 133 * When compressing then, you get a non-perceptible quality decrease, and a 134 * marginal performance increase. 135 * 136 * 4. All samplers must be set to linear filtering and clamp. 137 * 138 * After you get the technique working, remember that 64-bit inputs have 139 * half-rate linear filtering on GCN. 140 * 141 * If SMAA is applied to 64-bit color buffers, switching to point filtering 142 * when accesing them will increase the performance. Search for 143 * 'SMAASamplePoint' to see which textures may benefit from point 144 * filtering, and where (which is basically the color input in the edge 145 * detection and resolve passes). 146 * 147 * 5. All texture reads and buffer writes must be non-sRGB, with the exception 148 * of the input read and the output write in 149 * 'SMAANeighborhoodBlending' (and only in this pass!). If sRGB reads in 150 * this last pass are not possible, the technique will work anyway, but 151 * will perform antialiasing in gamma space. 152 * 153 * IMPORTANT: for best results the input read for the color/luma edge 154 * detection should *NOT* be sRGB. 155 * 156 * 6. Before including SMAA.h you'll have to setup the render target metrics, 157 * the target and any optional configuration defines. Optionally you can 158 * use a preset. 159 * 160 * You have the following targets available: 161 * SMAA_HLSL_3 162 * SMAA_HLSL_4 163 * SMAA_HLSL_4_1 164 * SMAA_GLSL_3 * 165 * SMAA_GLSL_4 * 166 * 167 * * (See SMAA_INCLUDE_VS and SMAA_INCLUDE_PS below). 168 * 169 * And four presets: 170 * SMAA_PRESET_LOW (%60 of the quality) 171 * SMAA_PRESET_MEDIUM (%80 of the quality) 172 * SMAA_PRESET_HIGH (%95 of the quality) 173 * SMAA_PRESET_ULTRA (%99 of the quality) 174 * 175 * For example: 176 * #define SMAA_RT_METRICS float4(1.0 / 1280.0, 1.0 / 720.0, 1280.0, 720.0) 177 * #define SMAA_HLSL_4 178 * #define SMAA_PRESET_HIGH 179 * #include "SMAA.h" 180 * 181 * Note that SMAA_RT_METRICS doesn't need to be a macro, it can be a 182 * uniform variable. The code is designed to minimize the impact of not 183 * using a constant value, but it is still better to hardcode it. 184 * 185 * Depending on how you encoded 'areaTex' and 'searchTex', you may have to 186 * add (and customize) the following defines before including SMAA.h: 187 * #define SMAA_AREATEX_SELECT(sample) sample.rg 188 * #define SMAA_SEARCHTEX_SELECT(sample) sample.r 189 * 190 * If your engine is already using porting macros, you can define 191 * SMAA_CUSTOM_SL, and define the porting functions by yourself. 192 * 193 * 7. Then, you'll have to setup the passes as indicated in the scheme above. 194 * You can take a look into SMAA.fx, to see how we did it for our demo. 195 * Checkout the function wrappers, you may want to copy-paste them! 196 * 197 * 8. It's recommended to validate the produced |edgesTex| and |blendTex|. 198 * You can use a screenshot from your engine to compare the |edgesTex| 199 * and |blendTex| produced inside of the engine with the results obtained 200 * with the reference demo. 201 * 202 * 9. After you get the last pass to work, it's time to optimize. You'll have 203 * to initialize a stencil buffer in the first pass (discard is already in 204 * the code), then mask execution by using it the second pass. The last 205 * pass should be executed in all pixels. 206 * 207 * 208 * After this point you can choose to enable predicated thresholding, 209 * temporal supersampling and motion blur integration: 210 * 211 * a) If you want to use predicated thresholding, take a look into 212 * SMAA_PREDICATION; you'll need to pass an extra texture in the edge 213 * detection pass. 214 * 215 * b) If you want to enable temporal supersampling (SMAA T2x): 216 * 217 * 1. The first step is to render using subpixel jitters. I won't go into 218 * detail, but it's as simple as moving each vertex position in the 219 * vertex shader, you can check how we do it in our DX10 demo. 220 * 221 * 2. Then, you must setup the temporal resolve. You may want to take a look 222 * into SMAAResolve for resolving 2x modes. After you get it working, you'll 223 * probably see ghosting everywhere. But fear not, you can enable the 224 * CryENGINE temporal reprojection by setting the SMAA_REPROJECTION macro. 225 * Check out SMAA_DECODE_VELOCITY if your velocity buffer is encoded. 226 * 227 * 3. The next step is to apply SMAA to each subpixel jittered frame, just as 228 * done for 1x. 229 * 230 * 4. At this point you should already have something usable, but for best 231 * results the proper area textures must be set depending on current jitter. 232 * For this, the parameter 'subsampleIndices' of 233 * 'SMAABlendingWeightCalculationPS' must be set as follows, for our T2x 234 * mode: 235 * 236 * @SUBSAMPLE_INDICES 237 * 238 * | S# | Camera Jitter | subsampleIndices | 239 * +----+------------------+---------------------+ 240 * | 0 | ( 0.25, -0.25) | float4(1, 1, 1, 0) | 241 * | 1 | (-0.25, 0.25) | float4(2, 2, 2, 0) | 242 * 243 * These jitter positions assume a bottom-to-top y axis. S# stands for the 244 * sample number. 245 * 246 * More information about temporal supersampling here: 247 * http://iryoku.com/aacourse/downloads/13-Anti-Aliasing-Methods-in-CryENGINE-3.pdf 248 * 249 * c) If you want to enable spatial multisampling (SMAA S2x): 250 * 251 * 1. The scene must be rendered using MSAA 2x. The MSAA 2x buffer must be 252 * created with: 253 * - DX10: see below (*) 254 * - DX10.1: D3D10_STANDARD_MULTISAMPLE_PATTERN or 255 * - DX11: D3D11_STANDARD_MULTISAMPLE_PATTERN 256 * 257 * This allows to ensure that the subsample order matches the table in 258 * @SUBSAMPLE_INDICES. 259 * 260 * (*) In the case of DX10, we refer the reader to: 261 * - SMAA::detectMSAAOrder and 262 * - SMAA::msaaReorder 263 * 264 * These functions allow to match the standard multisample patterns by 265 * detecting the subsample order for a specific GPU, and reordering 266 * them appropriately. 267 * 268 * 2. A shader must be run to output each subsample into a separate buffer 269 * (DX10 is required). You can use SMAASeparate for this purpose, or just do 270 * it in an existing pass (for example, in the tone mapping pass, which has 271 * the advantage of feeding tone mapped subsamples to SMAA, which will yield 272 * better results). 273 * 274 * 3. The full SMAA 1x pipeline must be run for each separated buffer, storing 275 * the results in the final buffer. The second run should alpha blend with 276 * the existing final buffer using a blending factor of 0.5. 277 * 'subsampleIndices' must be adjusted as in the SMAA T2x case (see point 278 * b). 279 * 280 * d) If you want to enable temporal supersampling on top of SMAA S2x 281 * (which actually is SMAA 4x): 282 * 283 * 1. SMAA 4x consists on temporally jittering SMAA S2x, so the first step is 284 * to calculate SMAA S2x for current frame. In this case, 'subsampleIndices' 285 * must be set as follows: 286 * 287 * | F# | S# | Camera Jitter | Net Jitter | subsampleIndices | 288 * +----+----+--------------------+-------------------+----------------------+ 289 * | 0 | 0 | ( 0.125, 0.125) | ( 0.375, -0.125) | float4(5, 3, 1, 3) | 290 * | 0 | 1 | ( 0.125, 0.125) | (-0.125, 0.375) | float4(4, 6, 2, 3) | 291 * +----+----+--------------------+-------------------+----------------------+ 292 * | 1 | 2 | (-0.125, -0.125) | ( 0.125, -0.375) | float4(3, 5, 1, 4) | 293 * | 1 | 3 | (-0.125, -0.125) | (-0.375, 0.125) | float4(6, 4, 2, 4) | 294 * 295 * These jitter positions assume a bottom-to-top y axis. F# stands for the 296 * frame number. S# stands for the sample number. 297 * 298 * 2. After calculating SMAA S2x for current frame (with the new subsample 299 * indices), previous frame must be reprojected as in SMAA T2x mode (see 300 * point b). 301 * 302 * e) If motion blur is used, you may want to do the edge detection pass 303 * together with motion blur. This has two advantages: 304 * 305 * 1. Pixels under heavy motion can be omitted from the edge detection process. 306 * For these pixels we can just store "no edge", as motion blur will take 307 * care of them. 308 * 2. The center pixel tap is reused. 309 * 310 * Note that in this case depth testing should be used instead of stenciling, 311 * as we have to write all the pixels in the motion blur pass. 312 * 313 * That's it! 314 */ 315 316 //----------------------------------------------------------------------------- 317 // SMAA Presets 318 319 /** 320 * Note that if you use one of these presets, the following configuration 321 * macros will be ignored if set in the "Configurable Defines" section. 322 */ 323 324 #if defined(SMAA_PRESET_LOW) 325 # define SMAA_THRESHOLD 0.15 326 # define SMAA_MAX_SEARCH_STEPS 4 327 # define SMAA_DISABLE_DIAG_DETECTION 328 # define SMAA_DISABLE_CORNER_DETECTION 329 #elif defined(SMAA_PRESET_MEDIUM) 330 # define SMAA_THRESHOLD 0.1 331 # define SMAA_MAX_SEARCH_STEPS 8 332 # define SMAA_DISABLE_DIAG_DETECTION 333 # define SMAA_DISABLE_CORNER_DETECTION 334 #elif defined(SMAA_PRESET_HIGH) 335 # define SMAA_THRESHOLD 0.1 336 # define SMAA_MAX_SEARCH_STEPS 16 337 # define SMAA_MAX_SEARCH_STEPS_DIAG 8 338 # define SMAA_CORNER_ROUNDING 25 339 #elif defined(SMAA_PRESET_ULTRA) 340 # define SMAA_THRESHOLD 0.05 341 # define SMAA_MAX_SEARCH_STEPS 32 342 # define SMAA_MAX_SEARCH_STEPS_DIAG 16 343 # define SMAA_CORNER_ROUNDING 25 344 #endif 345 346 //----------------------------------------------------------------------------- 347 // Configurable Defines 348 349 /** 350 * SMAA_THRESHOLD specifies the threshold or sensitivity to edges. 351 * Lowering this value you will be able to detect more edges at the expense of 352 * performance. 353 * 354 * Range: [0, 0.5] 355 * 0.1 is a reasonable value, and allows to catch most visible edges. 356 * 0.05 is a rather overkill value, that allows to catch 'em all. 357 * 358 * If temporal supersampling is used, 0.2 could be a reasonable value, as low 359 * contrast edges are properly filtered by just 2x. 360 */ 361 #ifndef SMAA_THRESHOLD 362 # define SMAA_THRESHOLD 0.1 363 #endif 364 365 /** 366 * SMAA_DEPTH_THRESHOLD specifies the threshold for depth edge detection. 367 * 368 * Range: depends on the depth range of the scene. 369 */ 370 #ifndef SMAA_DEPTH_THRESHOLD 371 # define SMAA_DEPTH_THRESHOLD (0.1 * SMAA_THRESHOLD) 372 #endif 373 374 /** 375 * SMAA_MAX_SEARCH_STEPS specifies the maximum steps performed in the 376 * horizontal/vertical pattern searches, at each side of the pixel. 377 * 378 * In number of pixels, it's actually the double. So the maximum line length 379 * perfectly handled by, for example 16, is 64 (by perfectly, we meant that 380 * longer lines won't look as good, but still antialiased). 381 * 382 * Range: [0, 112] 383 */ 384 #ifndef SMAA_MAX_SEARCH_STEPS 385 # define SMAA_MAX_SEARCH_STEPS 16 386 #endif 387 388 /** 389 * SMAA_MAX_SEARCH_STEPS_DIAG specifies the maximum steps performed in the 390 * diagonal pattern searches, at each side of the pixel. In this case we jump 391 * one pixel at time, instead of two. 392 * 393 * Range: [0, 20] 394 * 395 * On high-end machines it is cheap (between a 0.8x and 0.9x slower for 16 396 * steps), but it can have a significant impact on older machines. 397 * 398 * Define SMAA_DISABLE_DIAG_DETECTION to disable diagonal processing. 399 */ 400 #ifndef SMAA_MAX_SEARCH_STEPS_DIAG 401 # define SMAA_MAX_SEARCH_STEPS_DIAG 8 402 #endif 403 404 /** 405 * SMAA_CORNER_ROUNDING specifies how much sharp corners will be rounded. 406 * 407 * Range: [0, 100] 408 * 409 * Define SMAA_DISABLE_CORNER_DETECTION to disable corner processing. 410 */ 411 #ifndef SMAA_CORNER_ROUNDING 412 # define SMAA_CORNER_ROUNDING 25 413 #endif 414 415 /** 416 * If there is an neighbor edge that has SMAA_LOCAL_CONTRAST_FACTOR times 417 * bigger contrast than current edge, current edge will be discarded. 418 * 419 * This allows to eliminate spurious crossing edges, and is based on the fact 420 * that, if there is too much contrast in a direction, that will hide 421 * perceptually contrast in the other neighbors. 422 */ 423 #ifndef SMAA_LOCAL_CONTRAST_ADAPTATION_FACTOR 424 # define SMAA_LOCAL_CONTRAST_ADAPTATION_FACTOR 2.0 425 #endif 426 427 /** 428 * Predicated thresholding allows to better preserve texture details and to 429 * improve performance, by decreasing the number of detected edges using an 430 * additional buffer like the light accumulation buffer, object ids or even the 431 * depth buffer (the depth buffer usage may be limited to indoor or short range 432 * scenes). 433 * 434 * It locally decreases the luma or color threshold if an edge is found in an 435 * additional buffer (so the global threshold can be higher). 436 * 437 * This method was developed by Playstation EDGE MLAA team, and used in 438 * Killzone 3, by using the light accumulation buffer. More information here: 439 * http://iryoku.com/aacourse/downloads/06-MLAA-on-PS3.pptx 440 */ 441 #ifndef SMAA_PREDICATION 442 # define SMAA_PREDICATION 0 443 #endif 444 445 /** 446 * Threshold to be used in the additional predication buffer. 447 * 448 * Range: depends on the input, so you'll have to find the magic number that 449 * works for you. 450 */ 451 #ifndef SMAA_PREDICATION_THRESHOLD 452 # define SMAA_PREDICATION_THRESHOLD 0.01 453 #endif 454 455 /** 456 * How much to scale the global threshold used for luma or color edge 457 * detection when using predication. 458 * 459 * Range: [1, 5] 460 */ 461 #ifndef SMAA_PREDICATION_SCALE 462 # define SMAA_PREDICATION_SCALE 2.0 463 #endif 464 465 /** 466 * How much to locally decrease the threshold. 467 * 468 * Range: [0, 1] 469 */ 470 #ifndef SMAA_PREDICATION_STRENGTH 471 # define SMAA_PREDICATION_STRENGTH 0.4 472 #endif 473 474 /** 475 * Temporal reprojection allows to remove ghosting artifacts when using 476 * temporal supersampling. We use the CryEngine 3 method which also introduces 477 * velocity weighting. This feature is of extreme importance for totally 478 * removing ghosting. More information here: 479 * http://iryoku.com/aacourse/downloads/13-Anti-Aliasing-Methods-in-CryENGINE-3.pdf 480 * 481 * Note that you'll need to setup a velocity buffer for enabling reprojection. 482 * For static geometry, saving the previous depth buffer is a viable 483 * alternative. 484 */ 485 #ifndef SMAA_REPROJECTION 486 # define SMAA_REPROJECTION 0 487 #endif 488 489 /** 490 * SMAA_REPROJECTION_WEIGHT_SCALE controls the velocity weighting. It allows to 491 * remove ghosting trails behind the moving object, which are not removed by 492 * just using reprojection. Using low values will exhibit ghosting, while using 493 * high values will disable temporal supersampling under motion. 494 * 495 * Behind the scenes, velocity weighting removes temporal supersampling when 496 * the velocity of the subsamples differs (meaning they are different objects). 497 * 498 * Range: [0, 80] 499 */ 500 #ifndef SMAA_REPROJECTION_WEIGHT_SCALE 501 # define SMAA_REPROJECTION_WEIGHT_SCALE 30.0 502 #endif 503 504 /** 505 * On some compilers, discard cannot be used in vertex shaders. Thus, they need 506 * to be compiled separately. 507 */ 508 #ifndef SMAA_INCLUDE_VS 509 # define SMAA_INCLUDE_VS 1 510 #endif 511 #ifndef SMAA_INCLUDE_PS 512 # define SMAA_INCLUDE_PS 1 513 #endif 514 515 //----------------------------------------------------------------------------- 516 // Texture Access Defines 517 518 #ifndef SMAA_AREATEX_SELECT 519 # if defined(SMAA_HLSL_3) 520 # define SMAA_AREATEX_SELECT(sample) sample.ra 521 # else 522 # define SMAA_AREATEX_SELECT(sample) sample.rg 523 # endif 524 #endif 525 526 #ifndef SMAA_SEARCHTEX_SELECT 527 # define SMAA_SEARCHTEX_SELECT(sample) sample.r 528 #endif 529 530 #ifndef SMAA_DECODE_VELOCITY 531 # define SMAA_DECODE_VELOCITY(sample) sample.rg 532 #endif 533 534 //----------------------------------------------------------------------------- 535 // Non-Configurable Defines 536 537 #define SMAA_AREATEX_MAX_DISTANCE 16 538 #define SMAA_AREATEX_MAX_DISTANCE_DIAG 20 539 #define SMAA_AREATEX_PIXEL_SIZE (1.0 / float2(160.0, 560.0)) 540 #define SMAA_AREATEX_SUBTEX_SIZE (1.0 / 7.0) 541 #define SMAA_SEARCHTEX_SIZE float2(66.0, 33.0) 542 #define SMAA_SEARCHTEX_PACKED_SIZE float2(64.0, 16.0) 543 #define SMAA_CORNER_ROUNDING_NORM (float(SMAA_CORNER_ROUNDING) / 100.0) 544 545 //----------------------------------------------------------------------------- 546 // Porting Functions 547 548 #if defined(SMAA_HLSL_3) 549 # define SMAATexture2D(tex) sampler2D tex 550 # define SMAATexturePass2D(tex) tex 551 # define SMAASampleLevelZero(tex, coord) tex2Dlod(tex, float4(coord, 0.0, 0.0)) 552 # define SMAASampleLevelZeroPoint(tex, coord) tex2Dlod(tex, float4(coord, 0.0, 0.0)) 553 # define SMAASampleLevelZeroOffset(tex, coord, offset) \ 554 tex2Dlod(tex, float4(coord + offset * SMAA_RT_METRICS.xy, 0.0, 0.0)) 555 # define SMAASample(tex, coord) tex2D(tex, coord) 556 # define SMAASamplePoint(tex, coord) tex2D(tex, coord) 557 # define SMAASampleOffset(tex, coord, offset) tex2D(tex, coord + offset * SMAA_RT_METRICS.xy) 558 # define SMAA_FLATTEN [flatten] 559 # define SMAA_BRANCH [branch] 560 #endif 561 #if defined(SMAA_HLSL_4) || defined(SMAA_HLSL_4_1) 562 SamplerState LinearSampler 563 { 564 Filter = MIN_MAG_LINEAR_MIP_POINT; 565 AddressU = Clamp; 566 AddressV = Clamp; 567 }; 568 SamplerState PointSampler 569 { 570 Filter = MIN_MAG_MIP_POINT; 571 AddressU = Clamp; 572 AddressV = Clamp; 573 }; 574 # define SMAATexture2D(tex) Texture2D tex 575 # define SMAATexturePass2D(tex) tex 576 # define SMAASampleLevelZero(tex, coord) tex.SampleLevel(LinearSampler, coord, 0) 577 # define SMAASampleLevelZeroPoint(tex, coord) tex.SampleLevel(PointSampler, coord, 0) 578 # define SMAASampleLevelZeroOffset(tex, coord, offset) \ 579 tex.SampleLevel(LinearSampler, coord, 0, offset) 580 # define SMAASample(tex, coord) tex.Sample(LinearSampler, coord) 581 # define SMAASamplePoint(tex, coord) tex.Sample(PointSampler, coord) 582 # define SMAASampleOffset(tex, coord, offset) tex.Sample(LinearSampler, coord, offset) 583 # define SMAA_FLATTEN [flatten] 584 # define SMAA_BRANCH [branch] 585 # define SMAATexture2DMS2(tex) Texture2DMS tex 586 # define SMAALoad(tex, pos, sample) tex.Load(pos, sample) 587 # if defined(SMAA_HLSL_4_1) 588 # define SMAAGather(tex, coord) tex.Gather(LinearSampler, coord, 0) 589 # endif 590 #endif 591 #if defined(SMAA_GLSL_3) || defined(SMAA_GLSL_4) 592 # define SMAATexture2D(tex) sampler2D tex 593 # define SMAATexturePass2D(tex) tex 594 # define SMAASampleLevelZero(tex, coord) textureLod(tex, coord, 0.0) 595 # define SMAASampleLevelZeroPoint(tex, coord) textureLod(tex, coord, 0.0) 596 # define SMAASampleLevelZeroOffset(tex, coord, offset) textureLodOffset(tex, coord, 0.0, offset) 597 # define SMAASample(tex, coord) texture(tex, coord) 598 # define SMAASamplePoint(tex, coord) texture(tex, coord) 599 # define SMAASampleOffset(tex, coord, offset) texture(tex, coord, offset) 600 # define SMAA_FLATTEN 601 # define SMAA_BRANCH 602 # define lerp(a, b, t) mix(a, b, t) 603 # define saturate(a) clamp(a, 0.0, 1.0) 604 # if defined(SMAA_GLSL_4) 605 # define mad(a, b, c) fma(a, b, c) 606 # define SMAAGather(tex, coord) textureGather(tex, coord) 607 # else 608 # define mad(a, b, c) (a * b + c) 609 # endif 610 # define float2 vec2 611 # define float3 vec3 612 # define float4 vec4 613 # define int2 ivec2 614 # define int3 ivec3 615 # define int4 ivec4 616 # define bool2 bvec2 617 # define bool3 bvec3 618 # define bool4 bvec4 619 #endif 620 621 #if !defined(SMAA_HLSL_3) && !defined(SMAA_HLSL_4) && !defined(SMAA_HLSL_4_1) && \ 622 !defined(SMAA_GLSL_3) && !defined(SMAA_GLSL_4) && !defined(SMAA_CUSTOM_SL) 623 # error you must define the shading language: SMAA_HLSL_*, SMAA_GLSL_* or SMAA_CUSTOM_SL 624 #endif 625 626 //----------------------------------------------------------------------------- 627 // Misc functions 628 629 /** 630 * Gathers current pixel, and the top-left neighbors. 631 */ 632 float3 SMAAGatherNeighbours(float2 texcoord, float4 offset[3], SMAATexture2D(tex)) 633 { 634 #ifdef SMAAGather 635 return SMAAGather(tex, texcoord + SMAA_RT_METRICS.xy * float2(-0.5, -0.5)).grb; 636 #else 637 float P = SMAASamplePoint(tex, texcoord).r; 638 float Pleft = SMAASamplePoint(tex, offset[0].xy).r; 639 float Ptop = SMAASamplePoint(tex, offset[0].zw).r; 640 return float3(P, Pleft, Ptop); 641 #endif 642 } 643 644 /** 645 * Adjusts the threshold by means of predication. 646 */ 647 float2 SMAACalculatePredicatedThreshold(float2 texcoord, 648 float4 offset[3], 649 SMAATexture2D(predicationTex)) 650 { 651 float3 neighbours = SMAAGatherNeighbours(texcoord, offset, SMAATexturePass2D(predicationTex)); 652 float2 delta = abs(neighbours.xx - neighbours.yz); 653 float2 edges = step(SMAA_PREDICATION_THRESHOLD, delta); 654 return SMAA_PREDICATION_SCALE * SMAA_THRESHOLD * (1.0 - SMAA_PREDICATION_STRENGTH * edges); 655 } 656 657 /** 658 * Conditional move: 659 */ 660 void SMAAMovc(bool2 cond, inout float2 variable, float2 value) 661 { 662 SMAA_FLATTEN if (cond.x) variable.x = value.x; 663 SMAA_FLATTEN if (cond.y) variable.y = value.y; 664 } 665 666 void SMAAMovc(bool4 cond, inout float4 variable, float4 value) 667 { 668 SMAAMovc(cond.xy, variable.xy, value.xy); 669 SMAAMovc(cond.zw, variable.zw, value.zw); 670 } 671 672 #if SMAA_INCLUDE_VS 673 //----------------------------------------------------------------------------- 674 // Vertex Shaders 675 676 /** 677 * Edge Detection Vertex Shader 678 */ 679 void SMAAEdgeDetectionVS(float2 texcoord, out float4 offset[3]) 680 { 681 offset[0] = mad(SMAA_RT_METRICS.xyxy, float4(-1.0, 0.0, 0.0, -1.0), texcoord.xyxy); 682 offset[1] = mad(SMAA_RT_METRICS.xyxy, float4(1.0, 0.0, 0.0, 1.0), texcoord.xyxy); 683 offset[2] = mad(SMAA_RT_METRICS.xyxy, float4(-2.0, 0.0, 0.0, -2.0), texcoord.xyxy); 684 } 685 686 /** 687 * Blend Weight Calculation Vertex Shader 688 */ 689 void SMAABlendingWeightCalculationVS(float2 texcoord, out float2 pixcoord, out float4 offset[3]) 690 { 691 pixcoord = texcoord * SMAA_RT_METRICS.zw; 692 693 // We will use these offsets for the searches later on (see @PSEUDO_GATHER4): 694 offset[0] = mad(SMAA_RT_METRICS.xyxy, float4(-0.25, -0.125, 1.25, -0.125), texcoord.xyxy); 695 offset[1] = mad(SMAA_RT_METRICS.xyxy, float4(-0.125, -0.25, -0.125, 1.25), texcoord.xyxy); 696 697 // And these for the searches, they indicate the ends of the loops: 698 offset[2] = mad(SMAA_RT_METRICS.xxyy, 699 float4(-2.0, 2.0, -2.0, 2.0) * float(SMAA_MAX_SEARCH_STEPS), 700 float4(offset[0].xz, offset[1].yw)); 701 } 702 703 /** 704 * Neighborhood Blending Vertex Shader 705 */ 706 void SMAANeighborhoodBlendingVS(float2 texcoord, out float4 offset) 707 { 708 offset = mad(SMAA_RT_METRICS.xyxy, float4(1.0, 0.0, 0.0, 1.0), texcoord.xyxy); 709 } 710 #endif // SMAA_INCLUDE_VS 711 712 #if SMAA_INCLUDE_PS 713 //----------------------------------------------------------------------------- 714 // Edge Detection Pixel Shaders (First Pass) 715 716 # ifndef SMAA_LUMA_WEIGHT 717 # define SMAA_LUMA_WEIGHT float4(0.2126, 0.7152, 0.0722, 0.0) 718 # endif 719 720 /** 721 * Luma Edge Detection 722 * 723 * IMPORTANT NOTICE: luma edge detection requires gamma-corrected colors, and 724 * thus 'colorTex' should be a non-sRGB texture. 725 */ 726 float2 SMAALumaEdgeDetectionPS(float2 texcoord, 727 float4 offset[3], 728 SMAATexture2D(colorTex) 729 # if SMAA_PREDICATION 730 , 731 SMAATexture2D(predicationTex) 732 # endif 733 ) 734 { 735 // Calculate the threshold: 736 # if SMAA_PREDICATION 737 float2 threshold = SMAACalculatePredicatedThreshold( 738 texcoord, offset, SMAATexturePass2D(predicationTex)); 739 # else 740 float2 threshold = float2(SMAA_THRESHOLD, SMAA_THRESHOLD); 741 # endif 742 743 // Calculate lumas: 744 // float4 weights = float4(0.2126, 0.7152, 0.0722, 0.0); 745 float4 weights = SMAA_LUMA_WEIGHT; 746 float L = dot(SMAASamplePoint(colorTex, texcoord).rgba, weights); 747 748 float Lleft = dot(SMAASamplePoint(colorTex, offset[0].xy).rgba, weights); 749 float Ltop = dot(SMAASamplePoint(colorTex, offset[0].zw).rgba, weights); 750 751 // We do the usual threshold: 752 float4 delta; 753 delta.xy = abs(L - float2(Lleft, Ltop)); 754 float2 edges = step(threshold, delta.xy); 755 756 # ifndef SMAA_NO_DISCARD 757 // Then discard if there is no edge: 758 if (dot(edges, float2(1.0, 1.0)) == 0.0) 759 discard; 760 # endif 761 762 // Calculate right and bottom deltas: 763 float Lright = dot(SMAASamplePoint(colorTex, offset[1].xy).rgba, weights); 764 float Lbottom = dot(SMAASamplePoint(colorTex, offset[1].zw).rgba, weights); 765 delta.zw = abs(L - float2(Lright, Lbottom)); 766 767 // Calculate the maximum delta in the direct neighborhood: 768 float2 maxDelta = max(delta.xy, delta.zw); 769 770 // Calculate left-left and top-top deltas: 771 float Lleftleft = dot(SMAASamplePoint(colorTex, offset[2].xy).rgba, weights); 772 float Ltoptop = dot(SMAASamplePoint(colorTex, offset[2].zw).rgba, weights); 773 delta.zw = abs(float2(Lleft, Ltop) - float2(Lleftleft, Ltoptop)); 774 775 // Calculate the final maximum delta: 776 maxDelta = max(maxDelta.xy, delta.zw); 777 float finalDelta = max(maxDelta.x, maxDelta.y); 778 779 // Local contrast adaptation: 780 # if !defined(SHADER_API_OPENGL) 781 edges.xy *= step(finalDelta, SMAA_LOCAL_CONTRAST_ADAPTATION_FACTOR * delta.xy); 782 # endif 783 784 return edges; 785 } 786 787 /** 788 * Color Edge Detection 789 * 790 * IMPORTANT NOTICE: color edge detection requires gamma-corrected colors, and 791 * thus 'colorTex' should be a non-sRGB texture. 792 */ 793 float2 SMAAColorEdgeDetectionPS(float2 texcoord, 794 float4 offset[3], 795 SMAATexture2D(colorTex) 796 # if SMAA_PREDICATION 797 , 798 SMAATexture2D(predicationTex) 799 # endif 800 ) 801 { 802 // Calculate the threshold: 803 # if SMAA_PREDICATION 804 float2 threshold = SMAACalculatePredicatedThreshold(texcoord, offset, predicationTex); 805 # else 806 float2 threshold = float2(SMAA_THRESHOLD, SMAA_THRESHOLD); 807 # endif 808 809 // Calculate color deltas: 810 float4 delta; 811 float3 C = SMAASamplePoint(colorTex, texcoord).rgb; 812 813 float3 Cleft = SMAASamplePoint(colorTex, offset[0].xy).rgb; 814 float3 t = abs(C - Cleft); 815 delta.x = max(max(t.r, t.g), t.b); 816 817 float3 Ctop = SMAASamplePoint(colorTex, offset[0].zw).rgb; 818 t = abs(C - Ctop); 819 delta.y = max(max(t.r, t.g), t.b); 820 821 // We do the usual threshold: 822 float2 edges = step(threshold, delta.xy); 823 824 # ifndef SMAA_NO_DISCARD 825 // Then discard if there is no edge: 826 if (dot(edges, float2(1.0, 1.0)) == 0.0) 827 discard; 828 # endif 829 830 // Calculate right and bottom deltas: 831 float3 Cright = SMAASamplePoint(colorTex, offset[1].xy).rgb; 832 t = abs(C - Cright); 833 delta.z = max(max(t.r, t.g), t.b); 834 835 float3 Cbottom = SMAASamplePoint(colorTex, offset[1].zw).rgb; 836 t = abs(C - Cbottom); 837 delta.w = max(max(t.r, t.g), t.b); 838 839 // Calculate the maximum delta in the direct neighborhood: 840 float2 maxDelta = max(delta.xy, delta.zw); 841 842 // Calculate left-left and top-top deltas: 843 float3 Cleftleft = SMAASamplePoint(colorTex, offset[2].xy).rgb; 844 t = abs(C - Cleftleft); 845 delta.z = max(max(t.r, t.g), t.b); 846 847 float3 Ctoptop = SMAASamplePoint(colorTex, offset[2].zw).rgb; 848 t = abs(C - Ctoptop); 849 delta.w = max(max(t.r, t.g), t.b); 850 851 // Calculate the final maximum delta: 852 maxDelta = max(maxDelta.xy, delta.zw); 853 float finalDelta = max(maxDelta.x, maxDelta.y); 854 855 // Local contrast adaptation: 856 # if !defined(SHADER_API_OPENGL) 857 edges.xy *= step(finalDelta, SMAA_LOCAL_CONTRAST_ADAPTATION_FACTOR * delta.xy); 858 # endif 859 860 return edges; 861 } 862 863 /** 864 * Depth Edge Detection 865 */ 866 float2 SMAADepthEdgeDetectionPS(float2 texcoord, float4 offset[3], SMAATexture2D(depthTex)) 867 { 868 float3 neighbours = SMAAGatherNeighbours(texcoord, offset, SMAATexturePass2D(depthTex)); 869 float2 delta = abs(neighbours.xx - float2(neighbours.y, neighbours.z)); 870 float2 edges = step(SMAA_DEPTH_THRESHOLD, delta); 871 872 if (dot(edges, float2(1.0, 1.0)) == 0.0) 873 discard; 874 875 return edges; 876 } 877 878 //----------------------------------------------------------------------------- 879 // Diagonal Search Functions 880 881 # if !defined(SMAA_DISABLE_DIAG_DETECTION) 882 883 /** 884 * Allows to decode two binary values from a bilinear-filtered access. 885 */ 886 float2 SMAADecodeDiagBilinearAccess(float2 e) 887 { 888 // Bilinear access for fetching 'e' have a 0.25 offset, and we are 889 // interested in the R and G edges: 890 // 891 // +---G---+-------+ 892 // | x o R x | 893 // +-------+-------+ 894 // 895 // Then, if one of these edge is enabled: 896 // Red: (0.75 * X + 0.25 * 1) => 0.25 or 1.0 897 // Green: (0.75 * 1 + 0.25 * X) => 0.75 or 1.0 898 // 899 // This function will unpack the values (mad + mul + round): 900 // wolframalpha.com: round(x * abs(5 * x - 5 * 0.75)) plot 0 to 1 901 e.r = e.r * abs(5.0 * e.r - 5.0 * 0.75); 902 return round(e); 903 } 904 905 float4 SMAADecodeDiagBilinearAccess(float4 e) 906 { 907 e.rb = e.rb * abs(5.0 * e.rb - 5.0 * 0.75); 908 return round(e); 909 } 910 911 /** 912 * These functions allows to perform diagonal pattern searches. 913 */ 914 float2 SMAASearchDiag1(SMAATexture2D(edgesTex), float2 texcoord, float2 dir, out float2 e) 915 { 916 float4 coord = float4(texcoord, -1.0, 1.0); 917 float3 t = float3(SMAA_RT_METRICS.xy, 1.0); 918 while (coord.z < float(SMAA_MAX_SEARCH_STEPS_DIAG - 1) && coord.w > 0.9) { 919 coord.xyz = mad(t, float3(dir, 1.0), coord.xyz); 920 e = SMAASampleLevelZero(edgesTex, coord.xy).rg; 921 coord.w = dot(e, float2(0.5, 0.5)); 922 } 923 return coord.zw; 924 } 925 926 float2 SMAASearchDiag2(SMAATexture2D(edgesTex), float2 texcoord, float2 dir, out float2 e) 927 { 928 float4 coord = float4(texcoord, -1.0, 1.0); 929 coord.x += 0.25 * SMAA_RT_METRICS.x; // See @SearchDiag2Optimization 930 float3 t = float3(SMAA_RT_METRICS.xy, 1.0); 931 while (coord.z < float(SMAA_MAX_SEARCH_STEPS_DIAG - 1) && coord.w > 0.9) { 932 coord.xyz = mad(t, float3(dir, 1.0), coord.xyz); 933 934 // @SearchDiag2Optimization 935 // Fetch both edges at once using bilinear filtering: 936 e = SMAASampleLevelZero(edgesTex, coord.xy).rg; 937 e = SMAADecodeDiagBilinearAccess(e); 938 939 // Non-optimized version: 940 // e.g = SMAASampleLevelZero(edgesTex, coord.xy).g; 941 // e.r = SMAASampleLevelZeroOffset(edgesTex, coord.xy, int2(1, 0)).r; 942 943 coord.w = dot(e, float2(0.5, 0.5)); 944 } 945 return coord.zw; 946 } 947 948 /** 949 * Similar to SMAAArea, this calculates the area corresponding to a certain 950 * diagonal distance and crossing edges 'e'. 951 */ 952 float2 SMAAAreaDiag(SMAATexture2D(areaTex), float2 dist, float2 e, float offset) 953 { 954 float2 texcoord = mad( 955 float2(SMAA_AREATEX_MAX_DISTANCE_DIAG, SMAA_AREATEX_MAX_DISTANCE_DIAG), e, dist); 956 957 // We do a scale and bias for mapping to texel space: 958 texcoord = mad(SMAA_AREATEX_PIXEL_SIZE, texcoord, 0.5 * SMAA_AREATEX_PIXEL_SIZE); 959 960 // Diagonal areas are on the second half of the texture: 961 texcoord.x += 0.5; 962 963 // Move to proper place, according to the subpixel offset: 964 texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset; 965 966 // Do it! 967 return SMAA_AREATEX_SELECT(SMAASampleLevelZero(areaTex, texcoord)); 968 } 969 970 /** 971 * This searches for diagonal patterns and returns the corresponding weights. 972 */ 973 float2 SMAACalculateDiagWeights(SMAATexture2D(edgesTex), 974 SMAATexture2D(areaTex), 975 float2 texcoord, 976 float2 e, 977 float4 subsampleIndices) 978 { 979 float2 weights = float2(0.0, 0.0); 980 981 // Search for the line ends: 982 float4 d; 983 float2 end; 984 if (e.r > 0.0) { 985 d.xz = SMAASearchDiag1(SMAATexturePass2D(edgesTex), texcoord, float2(-1.0, 1.0), end); 986 d.x += float(end.y > 0.9); 987 } 988 else 989 d.xz = float2(0.0, 0.0); 990 d.yw = SMAASearchDiag1(SMAATexturePass2D(edgesTex), texcoord, float2(1.0, -1.0), end); 991 992 SMAA_BRANCH 993 if (d.x + d.y > 2.0) { // d.x + d.y + 1 > 3 994 // Fetch the crossing edges: 995 float4 coords = mad( 996 float4(-d.x + 0.25, d.x, d.y, -d.y - 0.25), SMAA_RT_METRICS.xyxy, texcoord.xyxy); 997 float4 c; 998 c.xy = SMAASampleLevelZeroOffset(edgesTex, coords.xy, int2(-1, 0)).rg; 999 c.zw = SMAASampleLevelZeroOffset(edgesTex, coords.zw, int2(1, 0)).rg; 1000 c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw); 1001 1002 // Non-optimized version: 1003 // float4 coords = mad(float4(-d.x, d.x, d.y, -d.y), SMAA_RT_METRICS.xyxy, texcoord.xyxy); 1004 // float4 c; 1005 // c.x = SMAASampleLevelZeroOffset(edgesTex, coords.xy, int2(-1, 0)).g; 1006 // c.y = SMAASampleLevelZeroOffset(edgesTex, coords.xy, int2( 0, 0)).r; 1007 // c.z = SMAASampleLevelZeroOffset(edgesTex, coords.zw, int2( 1, 0)).g; 1008 // c.w = SMAASampleLevelZeroOffset(edgesTex, coords.zw, int2( 1, -1)).r; 1009 1010 // Merge crossing edges at each side into a single value: 1011 float2 cc = mad(float2(2.0, 2.0), c.xz, c.yw); 1012 1013 // Remove the crossing edge if we didn't found the end of the line: 1014 SMAAMovc(bool2(step(0.9, d.zw)), cc, float2(0.0, 0.0)); 1015 1016 // Fetch the areas for this line: 1017 weights += SMAAAreaDiag(SMAATexturePass2D(areaTex), d.xy, cc, subsampleIndices.z); 1018 } 1019 1020 // Search for the line ends: 1021 d.xz = SMAASearchDiag2(SMAATexturePass2D(edgesTex), texcoord, float2(-1.0, -1.0), end); 1022 if (SMAASampleLevelZeroOffset(edgesTex, texcoord, int2(1, 0)).r > 0.0) { 1023 d.yw = SMAASearchDiag2(SMAATexturePass2D(edgesTex), texcoord, float2(1.0, 1.0), end); 1024 d.y += float(end.y > 0.9); 1025 } 1026 else 1027 d.yw = float2(0.0, 0.0); 1028 1029 SMAA_BRANCH 1030 if (d.x + d.y > 2.0) { // d.x + d.y + 1 > 3 1031 // Fetch the crossing edges: 1032 float4 coords = mad(float4(-d.x, -d.x, d.y, d.y), SMAA_RT_METRICS.xyxy, texcoord.xyxy); 1033 float4 c; 1034 c.x = SMAASampleLevelZeroOffset(edgesTex, coords.xy, int2(-1, 0)).g; 1035 c.y = SMAASampleLevelZeroOffset(edgesTex, coords.xy, int2(0, -1)).r; 1036 c.zw = SMAASampleLevelZeroOffset(edgesTex, coords.zw, int2(1, 0)).gr; 1037 float2 cc = mad(float2(2.0, 2.0), c.xz, c.yw); 1038 1039 // Remove the crossing edge if we didn't found the end of the line: 1040 SMAAMovc(bool2(step(0.9, d.zw)), cc, float2(0.0, 0.0)); 1041 1042 // Fetch the areas for this line: 1043 weights += SMAAAreaDiag(SMAATexturePass2D(areaTex), d.xy, cc, subsampleIndices.w).gr; 1044 } 1045 1046 return weights; 1047 } 1048 # endif 1049 1050 //----------------------------------------------------------------------------- 1051 // Horizontal/Vertical Search Functions 1052 1053 /** 1054 * This allows to determine how much length should we add in the last step 1055 * of the searches. It takes the bilinearly interpolated edge (see 1056 * @PSEUDO_GATHER4), and adds 0, 1 or 2, depending on which edges and 1057 * crossing edges are active. 1058 */ 1059 float SMAASearchLength(SMAATexture2D(searchTex), float2 e, float offset) 1060 { 1061 // The texture is flipped vertically, with left and right cases taking half 1062 // of the space horizontally: 1063 float2 scale = SMAA_SEARCHTEX_SIZE * float2(0.5, -1.0); 1064 float2 bias = SMAA_SEARCHTEX_SIZE * float2(offset, 1.0); 1065 1066 // Scale and bias to access texel centers: 1067 scale += float2(-1.0, 1.0); 1068 bias += float2(0.5, -0.5); 1069 1070 // Convert from pixel coordinates to texcoords: 1071 // (We use SMAA_SEARCHTEX_PACKED_SIZE because the texture is cropped) 1072 scale *= 1.0 / SMAA_SEARCHTEX_PACKED_SIZE; 1073 bias *= 1.0 / SMAA_SEARCHTEX_PACKED_SIZE; 1074 1075 // Lookup the search texture: 1076 return SMAA_SEARCHTEX_SELECT(SMAASampleLevelZero(searchTex, mad(scale, e, bias))); 1077 } 1078 1079 /** 1080 * Horizontal/vertical search functions for the 2nd pass. 1081 */ 1082 float SMAASearchXLeft(SMAATexture2D(edgesTex), 1083 SMAATexture2D(searchTex), 1084 float2 texcoord, 1085 float end) 1086 { 1087 /** 1088 * @PSEUDO_GATHER4 1089 * This texcoord has been offset by (-0.25, -0.125) in the vertex shader to 1090 * sample between edge, thus fetching four edges in a row. 1091 * Sampling with different offsets in each direction allows to disambiguate 1092 * which edges are active from the four fetched ones. 1093 */ 1094 float2 e = float2(0.0, 1.0); 1095 while (texcoord.x > end && e.g > 0.8281 && // Is there some edge not activated? 1096 e.r == 0.0) { // Or is there a crossing edge that breaks the line? 1097 e = SMAASampleLevelZero(edgesTex, texcoord).rg; 1098 texcoord = mad(-float2(2.0, 0.0), SMAA_RT_METRICS.xy, texcoord); 1099 } 1100 1101 float offset = mad( 1102 -(255.0 / 127.0), SMAASearchLength(SMAATexturePass2D(searchTex), e, 0.0), 3.25); 1103 return mad(SMAA_RT_METRICS.x, offset, texcoord.x); 1104 1105 // Non-optimized version: 1106 // We correct the previous (-0.25, -0.125) offset we applied: 1107 // texcoord.x += 0.25 * SMAA_RT_METRICS.x; 1108 1109 // The searches are bias by 1, so adjust the coords accordingly: 1110 // texcoord.x += SMAA_RT_METRICS.x; 1111 1112 // Disambiguate the length added by the last step: 1113 // texcoord.x += 2.0 * SMAA_RT_METRICS.x; // Undo last step 1114 // texcoord.x -= SMAA_RT_METRICS.x * (255.0 / 127.0) * 1115 // SMAASearchLength(SMAATexturePass2D(searchTex), e, 0.0); return mad(SMAA_RT_METRICS.x, offset, 1116 // texcoord.x); 1117 } 1118 1119 float SMAASearchXRight(SMAATexture2D(edgesTex), 1120 SMAATexture2D(searchTex), 1121 float2 texcoord, 1122 float end) 1123 { 1124 float2 e = float2(0.0, 1.0); 1125 while (texcoord.x < end && e.g > 0.8281 && // Is there some edge not activated? 1126 e.r == 0.0) { // Or is there a crossing edge that breaks the line? 1127 e = SMAASampleLevelZero(edgesTex, texcoord).rg; 1128 texcoord = mad(float2(2.0, 0.0), SMAA_RT_METRICS.xy, texcoord); 1129 } 1130 float offset = mad( 1131 -(255.0 / 127.0), SMAASearchLength(SMAATexturePass2D(searchTex), e, 0.5), 3.25); 1132 return mad(-SMAA_RT_METRICS.x, offset, texcoord.x); 1133 } 1134 1135 float SMAASearchYUp(SMAATexture2D(edgesTex), SMAATexture2D(searchTex), float2 texcoord, float end) 1136 { 1137 float2 e = float2(1.0, 0.0); 1138 while (texcoord.y > end && e.r > 0.8281 && // Is there some edge not activated? 1139 e.g == 0.0) { // Or is there a crossing edge that breaks the line? 1140 e = SMAASampleLevelZero(edgesTex, texcoord).rg; 1141 texcoord = mad(-float2(0.0, 2.0), SMAA_RT_METRICS.xy, texcoord); 1142 } 1143 float offset = mad( 1144 -(255.0 / 127.0), SMAASearchLength(SMAATexturePass2D(searchTex), e.gr, 0.0), 3.25); 1145 return mad(SMAA_RT_METRICS.y, offset, texcoord.y); 1146 } 1147 1148 float SMAASearchYDown(SMAATexture2D(edgesTex), 1149 SMAATexture2D(searchTex), 1150 float2 texcoord, 1151 float end) 1152 { 1153 float2 e = float2(1.0, 0.0); 1154 while (texcoord.y < end && e.r > 0.8281 && // Is there some edge not activated? 1155 e.g == 0.0) { // Or is there a crossing edge that breaks the line? 1156 e = SMAASampleLevelZero(edgesTex, texcoord).rg; 1157 texcoord = mad(float2(0.0, 2.0), SMAA_RT_METRICS.xy, texcoord); 1158 } 1159 float offset = mad( 1160 -(255.0 / 127.0), SMAASearchLength(SMAATexturePass2D(searchTex), e.gr, 0.5), 3.25); 1161 return mad(-SMAA_RT_METRICS.y, offset, texcoord.y); 1162 } 1163 1164 /** 1165 * Ok, we have the distance and both crossing edges. So, what are the areas 1166 * at each side of current edge? 1167 */ 1168 float2 SMAAArea(SMAATexture2D(areaTex), float2 dist, float e1, float e2, float offset) 1169 { 1170 // Rounding prevents precision errors of bilinear filtering: 1171 float2 texcoord = mad(float2(SMAA_AREATEX_MAX_DISTANCE, SMAA_AREATEX_MAX_DISTANCE), 1172 round(4.0 * float2(e1, e2)), 1173 dist); 1174 1175 // We do a scale and bias for mapping to texel space: 1176 texcoord = mad(SMAA_AREATEX_PIXEL_SIZE, texcoord, 0.5 * SMAA_AREATEX_PIXEL_SIZE); 1177 1178 // Move to proper place, according to the subpixel offset: 1179 texcoord.y = mad(SMAA_AREATEX_SUBTEX_SIZE, offset, texcoord.y); 1180 1181 // Do it! 1182 return SMAA_AREATEX_SELECT(SMAASampleLevelZero(areaTex, texcoord)); 1183 } 1184 1185 //----------------------------------------------------------------------------- 1186 // Corner Detection Functions 1187 1188 void SMAADetectHorizontalCornerPattern(SMAATexture2D(edgesTex), 1189 inout float2 weights, 1190 float4 texcoord, 1191 float2 d) 1192 { 1193 # if !defined(SMAA_DISABLE_CORNER_DETECTION) 1194 float2 leftRight = step(d.xy, d.yx); 1195 float2 rounding = (1.0 - SMAA_CORNER_ROUNDING_NORM) * leftRight; 1196 1197 rounding /= leftRight.x + leftRight.y; // Reduce blending for pixels in the center of a line. 1198 1199 float2 factor = float2(1.0, 1.0); 1200 factor.x -= rounding.x * SMAASampleLevelZeroOffset(edgesTex, texcoord.xy, int2(0, 1)).r; 1201 factor.x -= rounding.y * SMAASampleLevelZeroOffset(edgesTex, texcoord.zw, int2(1, 1)).r; 1202 factor.y -= rounding.x * SMAASampleLevelZeroOffset(edgesTex, texcoord.xy, int2(0, -2)).r; 1203 factor.y -= rounding.y * SMAASampleLevelZeroOffset(edgesTex, texcoord.zw, int2(1, -2)).r; 1204 1205 weights *= saturate(factor); 1206 # endif 1207 } 1208 1209 void SMAADetectVerticalCornerPattern(SMAATexture2D(edgesTex), 1210 inout float2 weights, 1211 float4 texcoord, 1212 float2 d) 1213 { 1214 # if !defined(SMAA_DISABLE_CORNER_DETECTION) 1215 float2 leftRight = step(d.xy, d.yx); 1216 float2 rounding = (1.0 - SMAA_CORNER_ROUNDING_NORM) * leftRight; 1217 1218 rounding /= leftRight.x + leftRight.y; 1219 1220 float2 factor = float2(1.0, 1.0); 1221 factor.x -= rounding.x * SMAASampleLevelZeroOffset(edgesTex, texcoord.xy, int2(1, 0)).g; 1222 factor.x -= rounding.y * SMAASampleLevelZeroOffset(edgesTex, texcoord.zw, int2(1, 1)).g; 1223 factor.y -= rounding.x * SMAASampleLevelZeroOffset(edgesTex, texcoord.xy, int2(-2, 0)).g; 1224 factor.y -= rounding.y * SMAASampleLevelZeroOffset(edgesTex, texcoord.zw, int2(-2, 1)).g; 1225 1226 weights *= saturate(factor); 1227 # endif 1228 } 1229 1230 //----------------------------------------------------------------------------- 1231 // Blending Weight Calculation Pixel Shader (Second Pass) 1232 1233 float4 SMAABlendingWeightCalculationPS(float2 texcoord, 1234 float2 pixcoord, 1235 float4 offset[3], 1236 SMAATexture2D(edgesTex), 1237 SMAATexture2D(areaTex), 1238 SMAATexture2D(searchTex), 1239 float4 subsampleIndices) 1240 { // Just pass zero for SMAA 1x, see @SUBSAMPLE_INDICES. 1241 float4 weights = float4(0.0, 0.0, 0.0, 0.0); 1242 1243 float2 e = SMAASample(edgesTex, texcoord).rg; 1244 1245 SMAA_BRANCH 1246 if (e.g > 0.0) { // Edge at north 1247 # if !defined(SMAA_DISABLE_DIAG_DETECTION) 1248 // Diagonals have both north and west edges, so searching for them in 1249 // one of the boundaries is enough. 1250 weights.rg = SMAACalculateDiagWeights( 1251 SMAATexturePass2D(edgesTex), SMAATexturePass2D(areaTex), texcoord, e, subsampleIndices); 1252 1253 // We give priority to diagonals, so if we find a diagonal we skip 1254 // horizontal/vertical processing. 1255 SMAA_BRANCH 1256 if (weights.r == -weights.g) { // weights.r + weights.g == 0.0 1257 # endif 1258 1259 float2 d; 1260 1261 // Find the distance to the left: 1262 float3 coords; 1263 coords.x = SMAASearchXLeft( 1264 SMAATexturePass2D(edgesTex), SMAATexturePass2D(searchTex), offset[0].xy, offset[2].x); 1265 coords.y = 1266 offset[1].y; // offset[1].y = texcoord.y - 0.25 * SMAA_RT_METRICS.y (@CROSSING_OFFSET) 1267 d.x = coords.x; 1268 1269 // Now fetch the left crossing edges, two at a time using bilinear 1270 // filtering. Sampling at -0.25 (see @CROSSING_OFFSET) enables to 1271 // discern what value each edge has: 1272 float e1 = SMAASampleLevelZero(edgesTex, coords.xy).r; 1273 1274 // Find the distance to the right: 1275 coords.z = SMAASearchXRight( 1276 SMAATexturePass2D(edgesTex), SMAATexturePass2D(searchTex), offset[0].zw, offset[2].y); 1277 d.y = coords.z; 1278 1279 // We want the distances to be in pixel units (doing this here allow to 1280 // better interleave arithmetic and memory accesses): 1281 d = abs(round(mad(SMAA_RT_METRICS.zz, d, -pixcoord.xx))); 1282 1283 // SMAAArea below needs a sqrt, as the areas texture is compressed 1284 // quadratically: 1285 float2 sqrt_d = sqrt(d); 1286 1287 // Fetch the right crossing edges: 1288 float e2 = SMAASampleLevelZeroOffset(edgesTex, coords.zy, int2(1, 0)).r; 1289 1290 // Ok, we know how this pattern looks like, now it is time for getting 1291 // the actual area: 1292 weights.rg = SMAAArea(SMAATexturePass2D(areaTex), sqrt_d, e1, e2, subsampleIndices.y); 1293 1294 // Fix corners: 1295 coords.y = texcoord.y; 1296 SMAADetectHorizontalCornerPattern(SMAATexturePass2D(edgesTex), weights.rg, coords.xyzy, d); 1297 1298 # if !defined(SMAA_DISABLE_DIAG_DETECTION) 1299 } 1300 else 1301 e.r = 0.0; // Skip vertical processing. 1302 # endif 1303 } 1304 1305 SMAA_BRANCH 1306 if (e.r > 0.0) { // Edge at west 1307 float2 d; 1308 1309 // Find the distance to the top: 1310 float3 coords; 1311 coords.y = SMAASearchYUp( 1312 SMAATexturePass2D(edgesTex), SMAATexturePass2D(searchTex), offset[1].xy, offset[2].z); 1313 coords.x = offset[0].x; // offset[1].x = texcoord.x - 0.25 * SMAA_RT_METRICS.x; 1314 d.x = coords.y; 1315 1316 // Fetch the top crossing edges: 1317 float e1 = SMAASampleLevelZero(edgesTex, coords.xy).g; 1318 1319 // Find the distance to the bottom: 1320 coords.z = SMAASearchYDown( 1321 SMAATexturePass2D(edgesTex), SMAATexturePass2D(searchTex), offset[1].zw, offset[2].w); 1322 d.y = coords.z; 1323 1324 // We want the distances to be in pixel units: 1325 d = abs(round(mad(SMAA_RT_METRICS.ww, d, -pixcoord.yy))); 1326 1327 // SMAAArea below needs a sqrt, as the areas texture is compressed 1328 // quadratically: 1329 float2 sqrt_d = sqrt(d); 1330 1331 // Fetch the bottom crossing edges: 1332 float e2 = SMAASampleLevelZeroOffset(edgesTex, coords.xz, int2(0, 1)).g; 1333 1334 // Get the area for this direction: 1335 weights.ba = SMAAArea(SMAATexturePass2D(areaTex), sqrt_d, e1, e2, subsampleIndices.x); 1336 1337 // Fix corners: 1338 coords.x = texcoord.x; 1339 SMAADetectVerticalCornerPattern(SMAATexturePass2D(edgesTex), weights.ba, coords.xyxz, d); 1340 } 1341 1342 return weights; 1343 } 1344 1345 //----------------------------------------------------------------------------- 1346 // Neighborhood Blending Pixel Shader (Third Pass) 1347 1348 float4 SMAANeighborhoodBlendingPS(float2 texcoord, 1349 float4 offset, 1350 SMAATexture2D(colorTex), 1351 SMAATexture2D(blendTex) 1352 # if SMAA_REPROJECTION 1353 , 1354 SMAATexture2D(velocityTex) 1355 # endif 1356 ) 1357 { 1358 // Fetch the blending weights for current pixel: 1359 float4 a; 1360 a.x = SMAASample(blendTex, offset.xy).a; // Right 1361 a.y = SMAASample(blendTex, offset.zw).g; // Top 1362 a.wz = SMAASample(blendTex, texcoord).xz; // Bottom / Left 1363 1364 // Is there any blending weight with a value greater than 0.0? 1365 SMAA_BRANCH 1366 if (dot(a, float4(1.0, 1.0, 1.0, 1.0)) < 1e-5) { 1367 float4 color = SMAASampleLevelZero(colorTex, texcoord); 1368 1369 # if SMAA_REPROJECTION 1370 float2 velocity = SMAA_DECODE_VELOCITY(SMAASampleLevelZero(velocityTex, texcoord)); 1371 1372 // Pack velocity into the alpha channel: 1373 color.a = sqrt(5.0 * length(velocity)); 1374 # endif 1375 1376 return color; 1377 } 1378 else { 1379 bool h = max(a.x, a.z) > max(a.y, a.w); // max(horizontal) > max(vertical) 1380 1381 // Calculate the blending offsets: 1382 float4 blendingOffset = float4(0.0, a.y, 0.0, a.w); 1383 float2 blendingWeight = a.yw; 1384 SMAAMovc(bool4(h, h, h, h), blendingOffset, float4(a.x, 0.0, a.z, 0.0)); 1385 SMAAMovc(bool2(h, h), blendingWeight, a.xz); 1386 blendingWeight /= dot(blendingWeight, float2(1.0, 1.0)); 1387 1388 // Calculate the texture coordinates: 1389 float4 blendingCoord = mad( 1390 blendingOffset, float4(SMAA_RT_METRICS.xy, -SMAA_RT_METRICS.xy), texcoord.xyxy); 1391 1392 // We exploit bilinear filtering to mix current pixel with the chosen 1393 // neighbor: 1394 float4 color = blendingWeight.x * SMAASampleLevelZero(colorTex, blendingCoord.xy); 1395 color += blendingWeight.y * SMAASampleLevelZero(colorTex, blendingCoord.zw); 1396 1397 # if SMAA_REPROJECTION 1398 // Antialias velocity for proper reprojection in a later stage: 1399 float2 velocity = blendingWeight.x * 1400 SMAA_DECODE_VELOCITY(SMAASampleLevelZero(velocityTex, blendingCoord.xy)); 1401 velocity += blendingWeight.y * 1402 SMAA_DECODE_VELOCITY(SMAASampleLevelZero(velocityTex, blendingCoord.zw)); 1403 1404 // Pack velocity into the alpha channel: 1405 color.a = sqrt(5.0 * length(velocity)); 1406 # endif 1407 1408 return color; 1409 } 1410 } 1411 1412 //----------------------------------------------------------------------------- 1413 // Temporal Resolve Pixel Shader (Optional Pass) 1414 1415 float4 SMAAResolvePS(float2 texcoord, 1416 SMAATexture2D(currentColorTex), 1417 SMAATexture2D(previousColorTex) 1418 # if SMAA_REPROJECTION 1419 , 1420 SMAATexture2D(velocityTex) 1421 # endif 1422 ) 1423 { 1424 # if SMAA_REPROJECTION 1425 // Velocity is assumed to be calculated for motion blur, so we need to 1426 // inverse it for reprojection: 1427 float2 velocity = -SMAA_DECODE_VELOCITY(SMAASamplePoint(velocityTex, texcoord).rg); 1428 1429 // Fetch current pixel: 1430 float4 current = SMAASamplePoint(currentColorTex, texcoord); 1431 1432 // Reproject current coordinates and fetch previous pixel: 1433 float4 previous = SMAASamplePoint(previousColorTex, texcoord + velocity); 1434 1435 // Attenuate the previous pixel if the velocity is different: 1436 float delta = abs(current.a * current.a - previous.a * previous.a) / 5.0; 1437 float weight = 0.5 * saturate(1.0 - sqrt(delta) * SMAA_REPROJECTION_WEIGHT_SCALE); 1438 1439 // Blend the pixels according to the calculated weight: 1440 return lerp(current, previous, weight); 1441 # else 1442 // Just blend the pixels: 1443 float4 current = SMAASamplePoint(currentColorTex, texcoord); 1444 float4 previous = SMAASamplePoint(previousColorTex, texcoord); 1445 return lerp(current, previous, 0.5); 1446 # endif 1447 } 1448 1449 //----------------------------------------------------------------------------- 1450 // Separate Multisamples Pixel Shader (Optional Pass) 1451 1452 # ifdef SMAALoad 1453 void SMAASeparatePS(float4 position, 1454 float2 texcoord, 1455 out float4 target0, 1456 out float4 target1, 1457 SMAATexture2DMS2(colorTexMS)) 1458 { 1459 int2 pos = int2(position.xy); 1460 target0 = SMAALoad(colorTexMS, pos, 0); 1461 target1 = SMAALoad(colorTexMS, pos, 1); 1462 } 1463 # endif 1464 1465 //----------------------------------------------------------------------------- 1466 #endif // SMAA_INCLUDE_PS 1467 1468 out vec2 uvs; 1469 out vec2 pixcoord; 1470 out vec4 offset[3]; 1471 1472 void main() 1473 { 1474 int v = gl_VertexID % 3; 1475 float x = -1.0 + float((v & 1) << 2); 1476 float y = -1.0 + float((v & 2) << 1); 1477 gl_Position = vec4(x, y, 1.0, 1.0); 1478 uvs = (gl_Position.xy + 1.0) * 0.5; 1479 1480 #if SMAA_STAGE == 0 1481 SMAAEdgeDetectionVS(uvs, offset); 1482 #elif SMAA_STAGE == 1 1483 SMAABlendingWeightCalculationVS(uvs, pixcoord, offset); 1484 #elif SMAA_STAGE == 2 1485 SMAANeighborhoodBlendingVS(uvs, offset[0]); 1486 #endif 1487 } 0(621) : error C0105: Syntax error in #if 0(621) : error C0105: Syntax error in #if 0(622) : error C0000: syntax error, unexpected '!' at token "!" 0(623) : error C0000: you must define the shading language: SMAA_HLSL_*, SMAA_GLSL_* or SMAA_CUSTOM_SL 0(640) : error C0000: syntax error, unexpected reserved word "return" at token "return" 0(654) : error C0000: syntax error, unexpected reserved word "return" at token "return" Error : EXCEPTION_ACCESS_VIOLATION Address : 0x0000000141F40C14 Module : Z:\dev\cmake-build\bin\Release\blender.exe