layout: post
title: “中级Shader教程25 两种涟漪实现方式”
date: 2018-04-26 16:09:03
author: Jiepeng Tan
categories:
- shader tutorial
tags: shader_tutorial theory shader
img_path: /assets/img/blog/ShaderTutorial2D/Snow
mathjax: true
Shader 视频教程
1.实现
1.空间划分+相邻grid之间采样实现
其中
y = sin(31.*t) * smoothstep(-0.6, -0.3, t) * smoothstep(0., -0.3,t)
图形解析为:
// create by JiepengTan 2018-04-25
// email: jiepengtan@gmail.com
// all right reserve
float _Ripple(float period,float spreadSpd,float waveGap,float2 uv,float rnd){
// sample the texture
const float WAVE_NUM = 2.;
const float CROSS_NUM = 1.0;
float ww