初次提交
This commit is contained in:
8
第16章 游戏开发中的物理学/Sample16_5/assets/frag_yh.sh
Normal file
8
第16章 游戏开发中的物理学/Sample16_5/assets/frag_yh.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
//焰火粒子着色器
|
||||
precision mediump float;
|
||||
uniform vec3 uColor;//粒子颜色
|
||||
void main()
|
||||
{
|
||||
//给此片元颜色值
|
||||
gl_FragColor = vec4(uColor,1.0);
|
||||
}
|
||||
15
第16章 游戏开发中的物理学/Sample16_5/assets/vertex_yh.sh
Normal file
15
第16章 游戏开发中的物理学/Sample16_5/assets/vertex_yh.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
uniform mat4 uMVPMatrix; //总变换矩阵
|
||||
uniform float uPointSize;//点尺寸
|
||||
uniform float uTime;
|
||||
attribute vec3 aVelocity; //顶点速度
|
||||
void main()
|
||||
{
|
||||
float currTime=mod(uTime,10.0);
|
||||
float px=aVelocity.x*currTime;
|
||||
float py=aVelocity.y*currTime-0.5*1.5*currTime*currTime+3.0;
|
||||
float pz=aVelocity.z*currTime;
|
||||
//根据总变换矩阵计算此次绘制此顶点位置
|
||||
gl_Position = uMVPMatrix * vec4(px,py,pz,1);
|
||||
//设置粒子尺寸
|
||||
gl_PointSize=uPointSize;
|
||||
}
|
||||
Reference in New Issue
Block a user