• Interactive Poisson Blending on GPU
    Interactive Poisson Blending on GPU
  • 404 Not Found In Two Triangles
    404 Not Found In Two Triangles
  • Simplest and Fastest GLSL Edge Detection using Fwidth
    Simplest and Fastest GLSL Edge Detection using Fwidth

Tag: ShaderToy

Unified Gnomonic and Stereographic Projections

Gnomonic projection, or rectilinear projection, together with stereographic projection, are two most commonly used projection in rendering 360 degree videos, or other VR applications. Recently, I found the inverse converting function from screen coordinates to the two projections can be unified within a single function. It’s not really surprising since both projection uses spherical lens,…


Equirectangular, Gnomonic Projections, and Cubemaps

Background According to MathWorld, the gnomonic projection is a nonconformal map projection obtained by projecting points P_1 (or P_2) on the surface of sphere from a sphere’s center O to point P in a plane that is tangent to a point S (Coxeter 1969, p. 93). In a gnomonic projection, great circles are mapped to…


0-4 Order of Spherical Harmonics

Spherical Harmonics is widely used in Computer Graphics. They are analogue to Fourier basis on a sphere, consists of a set of orthogonal functions to represent functions defined on the surface of a sphere. However, they are very tricky to implement due to lots of constants and integral functions. Here is a real-time visualization that…


Foveated Rendering via Quadtree

Today, I wrote a shader for foveated rendering uisng Prof. Neyret’s QuadTree: https://www.shadertoy.com/view/Ml3SDf The basic idea is:  Calculate the depth of the QuadTree using the distance between the current coordinate to the foveat region Use the depth as the mipmap level to sample from the texture Code below:

       


Bilateral Filter to Look Younger on GPU

Bilateral filter can be used to smooth the texture while preserving significant edges / contrast. Below shows a live demo in ShaderToy. Press mouse for comparison. Thanks to mrharicot’s awesome bilateral filter: https://www.shadertoy.com/view/4dfGDH With performance improvement proposed by athlete. With gamma correction by iq: https://www.shadertoy.com/view/XtsSzH   Skin detection forked from carlolsson’s Skin Detection https://www.shadertoy.com/view/MlfSzn#


Interactive Poisson Blending on GPU

Recently, I have implemented two fragment shaders for interactive Poisson Blending (seamless blending).  Here is my real-time demo and code on ShaderToy: Press 1 for normal mode, press 2 for mixed gradients, press space to clear the canvas. Technical Brief I followed a simplified routine of the Poisson Image Editing paper [P. Pérez, M. Gangnet,…


Simplest and Fatest GLSL Edge Detection using Fwidth

Yesterday, I read 834144373’s ShaderToy code which did Edge Detection in 97 chars, it was really simple and fast:

However, the result is astonishingly good: Let’s expand the code a little bit:

According to OpenGL manual: fwidth means  abs(dFdx(p)) + abs(dFdy(p)) and fwidthFine is equivalent to abs(dFdxFine(p)) + abs(dFdyFine(p)). One can use a sigmoid function to increase the…


Testing GPUs Computational Power

Have you think of how many summation & multiply operations can you do within for-loops in GPU fragment shader? I irrigorously tested the following fragment shader on ShaderToy, which gives me 100,000 operations at 22 FPS on a GTX 1080, for 25, 000 operations, it runs smoothly at 60 FPS. So, what’s the limitation of…


404 Not Found in Two Triangles

Inspred by 104 from ShaderToy, I made a new 404 Not Found page with two triangles in GLSL using calligraphic strokes. Live Demo Please visit: http://duruofei.com/404 or   Code

 


SIGGRAPH Asia 2014 Course Materials from iq/rgba

iñigo quilez kindly provides his SIGGRAPH Asia 2014 Course Materials of ShaderToy with me via email. Thank you iq! Thinking implicit: 2D, non polygonal shapes Coordinates and color gradients (That link is depracated, so I personally recommend this link instead) Shapping Texture Mapping Animation Reactivity More Media Yet More Media Thinking implicit: 3D Raymarching Modeling (primitives and…