Skip to content

Latest commit

 

History

History
717 lines (402 loc) · 11.7 KB

README.md

File metadata and controls

717 lines (402 loc) · 11.7 KB

This are GLSL examples of how to use LYGIA Shader Library. You can try them using:

How to start?

Clone this repository recursivelly

git clone --recursive https://github.com/patriciogonzalezvivo/lygia_examples.git

MATH

Functions

glslViewer math_functions.frag -l

Gaussian

glslViewer math_gaussian.frag -l

Quaternion

glslViewer math_quaternion.frag -l

ANIMATION

Easing

glslViewer animation_easing.frag -l

Sprite

glslViewer animation_sprite.frag -l

COLOR

Dither

glslViewer color_dither.frag -l

Dither Bayer

glslViewer color_dither_bayer.frag -l

LookUp table

glslViewer color_lut.frag assets/danny.png assets/square_01.png -l

Mix vs mixOklab vs MixBox color mixing

glslViewer color_mix.frag lygia/assets/mixbox_lut.png -l

Iridescence map

	glslViewer color_iridescence_map.frag -l

Spectral Wavelength to RGB

	glslViewer color_wavelength.frag -l

DRAW

AA functions

glslViewer draw_aa.frag -l

Digits

glslViewer draw_digits.frag -l

Julia

glslViewer draw_julia.frag -l

Mandelbulb

glslViewer draw_mandelbulb.frag -l

Shapes

glslViewer draw_shapes.frag -l

Super Shape

glslViewer draw_supershape.frag -l

GENERATIVE

Random

glslViewer generative_random.frag 

Clasic Noise

glslViewer generative_cnoise.frag 

Perlin Noise

glslViewer generative_pnoise.frag 

Simplex Noise

glslViewer generative_snoise.frag 

Tiling Simplex Flow Noise

glslViewer generative_psrdnoise.frag assets/sphere.ply -l

Simplex Noise Derivatives

glslViewer generative_noised.frag 

Curl Noise

glslViewer generative_curl.frag 

Fractal Brownian Motion

glslViewer generative_fbm.frag 

Voronoi

glslViewer generative_voronoi.frag 

Voronoise

glslViewer generative_voronoise.frag 

Worley Noise

glslViewer generative_worley.frag 

SAMPLE

Wrap clamp2edge vs repeat

	glslViewer sample_wrap.frag assets/rocks.png -l

Wrap repeat vs mirror

	glslViewer sample_wrap_mirror.frag assets/rocks.png -l

Wrap repeat vs untile

	glslViewer sample_wrap_untile.frag assets/rocks.png -l

Bracketing

	glslViewer sample_bracketing.frag assets/rock_moss.jpg -l

Bicubic filter

	glslViewer sample_filter_bicubic.frag assets/noise_blue.png -w 1080 -h 1080 --headless -E screenshot,

Nearest filter

	glslViewer sample_filter_nearest.frag assets/noise_blue.png -w 1080 -h 1080 --headless -E screenshot,

Smooth filter

	glslViewer sample_filter_smooth.frag assets/noise_blue.png -w 1080 -h 1080 --headless -E screenshot,

Sample EquiRectangular texture

	glslViewer sample_equirect.frag assets/dragon.obj assets/studio.png -e defined,SCENE_CUBEMAP,u_tex0 -e camera_position,-1.43923,0.891203,1.98093 -l

Sample 3D Sdf texture

	glslViewer sample_3Dsdf.frag assets/suzanne.png -e camera_position,-29.5393,26.2406,-42.1865 -l

Sample DoF

	glslViewer sample_dof.frag assets/dragon.obj -C assets/Arches_E_PineTree_3k.hdr -e camera_position,-1.43923,0.891203,1.98093 -l 

FILTER

boxBlur 1D

	glslViewer filter_boxBlur1D.frag assets/danny.png -e buffers,on -l

boxBlur 2D

filter_boxBlur2D:
	glslViewer filter_boxBlur2D.frag assets/danny.png -l

GaussianBlur 1D

	glslViewer filter_gaussianBlur1D.frag assets/danny.png -e buffers,on -l

GaussianBlur 2D

	glslViewer filter_gaussianBlur2D.frag assets/danny.png -l

FibonaccciBokeh

	glslViewer filter_fibonacciBokeh.frag assets/danny.png -l

BilateralBlur 2D

	glslViewer filter_bilateralBlur2D.frag assets/danny.png -l

RadialBlur 2D

	glslViewer filter_radialBlur2D.frag assets/danny.png -l

NoiseBlur 2D

	glslViewer filter_noiseBlur2D.frag assets/danny.png -l

Median 2D

	glslViewer filter_median2D.frag assets/danny.png -l

Kuwahara 2D

	glslViewer filter_kuwahara2D.frag assets/danny.png -l

Sharpen 2D

	glslViewer filter_sharpen2D.frag assets/danny.png -l

Laplacian 2D

	glslViewer filter_laplacian2D.frag assets/danny.png -l

Edge 2D

	glslViewer filter_edge2D.frag assets/danny.png -l

MORPHOLOGICAL

EROSION

	glslViewer morphological_erosion.frag assets/flower.png -l

DILATION

	glslViewer morphological_dilation.frag assets/flower.png -l

ALPHA FILL

	glslViewer morphological_alphaFill.frag assets/flower.png -l

Poisson Fill

	glslViewer morphological_poissonFill.frag assets/flower.png -l

Marching Squares

	glslViewer morphological_marchingSquares.frag assets/flower.png -l

LIGHTING

View Position (pass)

glslViewer assets/dragon.obj lighting_position.frag -e camera_position,1.43923,-0.891203,-1.98093 -l

View Normal (pass)

glslViewer assets/dragon.obj lighting_normal.frag -e camera_position,1.43923,-0.891203,-1.98093 -l

Shadow (material)

glslViewer assets/dragon.obj lighting_shadow.frag -e camera_position,1.43923,-0.891203,-1.98093 -l

ScreenSpace Ambient Occlusion (postprocessing)

glslViewer assets/dragon.obj lighting_ssao.frag -e camera_position,1.43923,-0.891203,-1.98093 -l

Gooch (material)

glslViewer assets/dragon.obj lighting_gooch.frag -e camera_position,1.43923,-0.891203,-1.98093 -l

SphereMap (material)

glslViewer assets/dragon.obj lighting_sphereMap.frag assets/matcap.jpg -e camera_position,-1.43923,0.891203,1.98093

Spherical Harmonics (material)

glslViewer assets/dragon.obj lighting_sphericalHarmonics.frag -e camera_position,-1.43923,0.891203,1.98093 -c assets/Arches_E_PineTree_3k.hdr --msaa --fxaa -e sky,on -l

PBR (material)

glslViewer assets/dragon.obj lighting_pbr.frag -e camera_position,1.43923,-0.891203,-1.98093 -C assets/uffizi_cross.hdr -e dynamic_shadows,on -l 

PBR ClearCoat (material)

glslViewer assets/dragon.obj lighting_pbrClearCoat.frag -e camera_position,1.43923,-0.891203,-1.98093 -C assets/uffizi_cross.hdr -e dynamic_shadows,on -l 

PBR Subsurface Scattering (material)

glslViewer assets/dragon.obj lighting_pbrSsS.frag -e camera_position,1.43923,-0.891203,-1.98093 -C assets/uffizi_cross.hdr -e dynamic_shadows,on -l 

PBR Glass (material)

glslViewer assets/dragon.obj lighting_pbrGlass.frag -e camera_position,1.43923,-0.891203,-1.98093 -C assets/uffizi_cross.hdr -e dynamic_shadows,on -l 

PBR Iridescence (material)

glslViewer assets/dragon.obj lighting_pbrIridescence.frag -e camera_position,-1.43923,0.891203,1.98093 --msaa -C assets/Arches_E_PineTree_3k.hdr -e dynamic_shadows,on -l 

ScreenSpace Reflections (postprocessing/raymarching)

glslViewer assets/dragon.obj lighting_ssr.frag -e camera_position,1.43923,-0.891203,-1.98093 -C assets/uffizi_cross.hdr -l 

Volumetric Light Scattering with Cubemap(postprocessing/raymarching)

glslViewer assets/dragon.obj lighting_volumetric.frag -e camera_position,-1.67433,0.0682091,-1.99539 -C assets/Arches_E_PineTree_3k.hdr -l 

Raymarching

glslViewer lighting_raymarching.frag -e camera_position,-29.5393,-26.2406,-42.1865 -l

Raymarching custom PBR with CUBEMAP

glslViewer lighting_raymarching_pbr.frag -e camera_position,-29.5393,-26.2406,-42.1865 -C assets/uffizi_cross.hdr -l

Raymarching custom GLASS material with CUBEMAP

glslViewer lighting_raymarching_glass.frag -e camera_position,-29.5393,-26.2406,-42.1865 -C assets/uffizi_cross.hdr -l

Raymarching GLASS REFRACTION material with CUBEMAP

glslViewer lighting_raymarching_glass_refraction.frag -e camera_position,29.5393,26.2406,42.1865 -c assets/uffizi_cross.hdr -l

Raymarching default VOLUME

glslViewer lighting_raymarching_volume.frag -e camera_position,-29.5393,-26.2406,-42.1865 -l

Atmosphere Scatering

glslViewer lighting_atmosphere.frag -l -w 1024 -h 512 -e define,PROJECTION_MODE,0

glslViewer lighting_atmosphere.frag -l -e define,PROJECTION_MODE,1