forked from Xeeynamo/sonic-hybrid-rsdk
-
Notifications
You must be signed in to change notification settings - Fork 3
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
3 changed files
with
149 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
sonic3air-main/Oxygen/oxygenengine/data/shader/simple_copy_screen.shader
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,49 @@ | ||
|
||
## ----- Shared ------------------------------------------------------------------- | ||
|
||
#version 130 | ||
|
||
precision mediump float; | ||
precision mediump int; | ||
|
||
|
||
|
||
## ----- Vertex ------------------------------------------------------------------- | ||
|
||
in vec2 position; | ||
out vec2 uv0; | ||
|
||
void main() | ||
{ | ||
uv0.xy = position.xy; | ||
gl_Position.x = position.x * 2.0 - 1.0; | ||
gl_Position.y = position.y * 2.0 - 1.0; | ||
gl_Position.z = 0.0; | ||
gl_Position.w = 1.0; | ||
} | ||
|
||
|
||
|
||
## ----- Fragment ----------------------------------------------------------------- | ||
|
||
in vec2 uv0; | ||
out vec4 FragColor; | ||
|
||
uniform sampler2D Texture; | ||
|
||
void main() | ||
{ | ||
FragColor = texture(Texture, uv0); | ||
} | ||
|
||
|
||
|
||
## ----- TECH --------------------------------------------------------------------- | ||
|
||
technique Standard | ||
{ | ||
blendfunc = opaque; | ||
vs = Shared + Vertex; | ||
fs = Shared + Fragment; | ||
vertexattrib[0] = position; | ||
} |
48 changes: 48 additions & 0 deletions
48
sonic3air-main/Oxygen/oxygenengine/data/shader/simple_rect_colored.shader
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,48 @@ | ||
|
||
## ----- Shared ------------------------------------------------------------------- | ||
|
||
#version 130 | ||
|
||
precision mediump float; | ||
precision mediump int; | ||
|
||
|
||
|
||
## ----- Vertex ------------------------------------------------------------------- | ||
|
||
in vec2 position; | ||
|
||
uniform vec4 Transform; | ||
|
||
void main() | ||
{ | ||
vec2 pos = vec2(Transform.x + position.x * Transform.z, Transform.y + position.y * Transform.w); | ||
|
||
// Intentionally using a z-value of 0.5 | ||
gl_Position = vec4(pos, 0.5, 1.0); | ||
} | ||
|
||
|
||
|
||
## ----- Fragment ----------------------------------------------------------------- | ||
|
||
out vec4 FragColor; | ||
|
||
uniform vec4 Color; | ||
|
||
void main() | ||
{ | ||
FragColor = Color; | ||
} | ||
|
||
|
||
|
||
## ----- TECH --------------------------------------------------------------------- | ||
|
||
technique Standard | ||
{ | ||
blendfunc = alpha; | ||
vs = Shared + Vertex; | ||
fs = Shared + Fragment; | ||
vertexattrib[0] = position; | ||
} |
52 changes: 52 additions & 0 deletions
52
sonic3air-main/Oxygen/oxygenengine/data/shader/simple_rect_depthwrite.shader
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,52 @@ | ||
|
||
## ----- Shared ------------------------------------------------------------------- | ||
|
||
#version 130 | ||
|
||
precision mediump float; | ||
precision mediump int; | ||
|
||
|
||
|
||
## ----- Vertex ------------------------------------------------------------------- | ||
|
||
in vec2 position; | ||
|
||
uniform ivec4 Rect; | ||
uniform ivec2 GameResolution; | ||
uniform float DepthValue; | ||
|
||
void main() | ||
{ | ||
ivec2 screenPosition; | ||
screenPosition.x = Rect.x + int(position.x * float(Rect.z) + 0.5); | ||
screenPosition.y = Rect.y + int(position.y * float(Rect.w) + 0.5); | ||
|
||
gl_Position.x = float(screenPosition.x) / float(GameResolution.x) * 2.0 - 1.0; | ||
gl_Position.y = float(screenPosition.y) / float(GameResolution.y) * 2.0 - 1.0; | ||
gl_Position.z = DepthValue; | ||
gl_Position.w = 1.0; | ||
} | ||
|
||
|
||
|
||
## ----- Fragment ----------------------------------------------------------------- | ||
|
||
out vec4 FragColor; | ||
|
||
void main() | ||
{ | ||
FragColor = vec4(0.0, 0.0, 0.0, 1.0); | ||
} | ||
|
||
|
||
|
||
## ----- TECH --------------------------------------------------------------------- | ||
|
||
technique Standard | ||
{ | ||
blendfunc = add; | ||
vs = Shared + Vertex; | ||
fs = Shared + Fragment; | ||
vertexattrib[0] = position; | ||
} |