-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
486 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#define PT_RIBBON_VERTEX_STAGE 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "../common/bgfx_compute.sh" | ||
#include "../UniformDefines/U_Particle.sh" | ||
|
||
BUFFER_RW(AllRibbonParticleVertex, vec4, PT_RIBBON_VERTEX_STAGE); | ||
|
||
uniform vec4 u_ribbonCount; | ||
// x : allRibbonVertexCount | ||
// y : particleActiveCount | ||
|
||
uniform vec4 u_ribbonMaxPos[300]; | ||
//here have max particle count (max limit of inspector) | ||
|
||
NUM_THREADS(1u, 1u, 1u) | ||
void main() | ||
{ | ||
for(uint i = 0,index= 0; i <u_ribbonCount.x; i += 2,index++) | ||
{ | ||
AllRibbonParticleVertex[i] = vec4( | ||
u_ribbonMaxPos[index].x, | ||
u_ribbonMaxPos[index].y + 1.0f, | ||
u_ribbonMaxPos[index].z, | ||
0.0f | ||
); | ||
|
||
AllRibbonParticleVertex[i+1] = vec4( | ||
u_ribbonMaxPos[index].x, | ||
u_ribbonMaxPos[index].y - 1.0f, | ||
u_ribbonMaxPos[index].z, | ||
0.0f | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$input v_color0, v_texcoord0 | ||
#include "../common/common.sh" | ||
|
||
SAMPLER2D(r_texColor, 1); | ||
|
||
void main() | ||
{ | ||
vec4 rgba = texture2D(r_texColor, v_texcoord0.xy); | ||
|
||
rgba.xyz = rgba.xyz * v_color0.xyz; | ||
rgba.w = rgba.w * v_color0.w; | ||
gl_FragColor = rgba; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$input a_position, a_color0, a_texcoord0 | ||
|
||
$output v_color0, v_texcoord0 | ||
|
||
#include "../common/common.sh" | ||
uniform vec4 u_particleColor; | ||
|
||
void main() | ||
{ | ||
gl_Position = mul(u_modelViewProj, vec4(a_position,1.0)); | ||
v_color0 = a_color0 * u_particleColor; | ||
v_texcoord0 = a_texcoord0; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.