Skip to content

Commit

Permalink
Added custom shaders.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinnegatamante committed Jan 12, 2019
1 parent 9714cc8 commit 926f1f0
Show file tree
Hide file tree
Showing 27 changed files with 111 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Expand Up @@ -75,8 +75,8 @@ OBJS := $(addsuffix .o,$(BINFILES)) $(CFILES:.c=.o) $(CPPFILES:.cpp=.o)
PREFIX = arm-vita-eabi
CC = $(PREFIX)-gcc
CXX = $(PREFIX)-g++
CFLAGS = -w -fno-lto -Wl,-q -Wall -O3 -g -Did386="0" -DGLQUAKE -DHAVE_OGGVORBIS -DHAVE_MPG123 -DHAVE_LIBSPEEXDSP -DUSE_AUDIO_RESAMPLER -DWANT_FMMIDI=1 -DQUAKE2RJ -DRJNET -fno-short-enums -ffast-math
CXXFLAGS = $(CFLAGS) -fno-exceptions -std=gnu++11
CFLAGS = -w -Wl,-q -Wall -O3 -g -Did386="0" -DGLQUAKE -DHAVE_OGGVORBIS -DHAVE_MPG123 -DHAVE_LIBSPEEXDSP -DUSE_AUDIO_RESAMPLER -DWANT_FMMIDI=1 -DQUAKE2RJ -DRJNET -fno-short-enums -ffast-math
CXXFLAGS = $(CFLAGS) -fpermissive -fno-exceptions -std=gnu++11
ASFLAGS = $(CFLAGS)

all: $(TARGET).vpk
Expand All @@ -87,7 +87,7 @@ $(TARGET).vpk: $(TARGET).velf
cp -f param.sfo build/sce_sys/param.sfo

#------------ Comment this if you don't have 7zip ------------------
7z a -tzip ../$(TARGET).vpk -r build\sce_sys\* build\eboot.bin
7z a -tzip $(TARGET).vpk -r ./build/sce_sys ./build/eboot.bin ./build/shaders
#-------------------------------------------------------------------

%.velf: %.elf
Expand All @@ -98,7 +98,7 @@ $(TARGET).elf: $(OBJS)
$(CXX) $(CXXFLAGS) $^ $(LIBS) -o $@

clean:
@rm -rf $(TARGET).velf $(TARGET).elf $(OBJS)
@rm -rf $(TARGET).velf $(TARGET).elf $(OBJS) $(TARGET).elf.unstripped.elf $(TARGET).vpk build/eboot.bin build/sce_sys/param.sfo ./param.sfo

run: $(TARGET).velf
@sh run_homebrew_unity.sh $(TARGET).velf
Binary file added build/shaders/modulate_alpha_f.gxp
Binary file not shown.
Binary file added build/shaders/modulate_f.gxp
Binary file not shown.
Binary file added build/shaders/modulate_rgba_alpha_f.gxp
Binary file not shown.
Binary file added build/shaders/modulate_rgba_f.gxp
Binary file not shown.
Binary file added build/shaders/replace_alpha_f.gxp
Binary file not shown.
Binary file added build/shaders/replace_f.gxp
Binary file not shown.
Binary file added build/shaders/rgba_alpha_f.gxp
Binary file not shown.
Binary file added build/shaders/rgba_f.gxp
Binary file not shown.
Binary file added build/shaders/rgba_v.gxp
Binary file not shown.
Binary file added build/shaders/texture2d_rgba_v.gxp
Binary file not shown.
Binary file added build/shaders/texture2d_v.gxp
Binary file not shown.
Binary file added build/shaders/vertex_f.gxp
Binary file not shown.
Binary file added build/shaders/vertex_v.gxp
Binary file not shown.
10 changes: 10 additions & 0 deletions shaders/modulate_alpha_f.cg
@@ -0,0 +1,10 @@
float4 main(
float2 vTexcoord : TEXCOORD0,
uniform float4 vColor,
uniform sampler2D tex
)
{
float4 c = tex2D(tex, vTexcoord) * vColor;
if (c.a > 0.666) return c;
else discard;
}
8 changes: 8 additions & 0 deletions shaders/modulate_f.cg
@@ -0,0 +1,8 @@
float4 main(
float2 vTexcoord : TEXCOORD0,
uniform float4 vColor,
uniform sampler2D tex
)
{
return tex2D(tex, vTexcoord) * vColor;
}
10 changes: 10 additions & 0 deletions shaders/modulate_rgba_alpha_f.cg
@@ -0,0 +1,10 @@
float4 main(
float2 vTexcoord : TEXCOORD0,
float4 vColor : COLOR,
uniform sampler2D tex
)
{
float4 c = tex2D(tex, vTexcoord) * vColor;
if (c.a > 0.666) return c;
else discard;
}
8 changes: 8 additions & 0 deletions shaders/modulate_rgba_f.cg
@@ -0,0 +1,8 @@
float4 main(
float2 vTexcoord : TEXCOORD0,
float4 vColor : COLOR,
uniform sampler2D tex
)
{
return tex2D(tex, vTexcoord) * vColor;
}
9 changes: 9 additions & 0 deletions shaders/replace_alpha_f.cg
@@ -0,0 +1,9 @@
float4 main(
float2 vTexcoord : TEXCOORD0,
uniform sampler2D tex
)
{
float4 c = tex2D(tex, vTexcoord);
if (c.a > 0.666) return c;
else discard;
}
7 changes: 7 additions & 0 deletions shaders/replace_f.cg
@@ -0,0 +1,7 @@
float4 main(
float2 vTexcoord : TEXCOORD0,
uniform sampler2D tex
)
{
return tex2D(tex, vTexcoord);
}
5 changes: 5 additions & 0 deletions shaders/rgba_alpha_f.cg
@@ -0,0 +1,5 @@
float4 main(float4 vColor : COLOR) : COLOR
{
if (vColor.a > 0.666) return vColor;
else discard;
}
4 changes: 4 additions & 0 deletions shaders/rgba_f.cg
@@ -0,0 +1,4 @@
float4 main(float4 vColor : COLOR) : COLOR
{
return vColor;
}
11 changes: 11 additions & 0 deletions shaders/rgba_v.cg
@@ -0,0 +1,11 @@
void main(
float3 aPosition,
float4 aColor,
column_major uniform float4x4 wvp,
float4 out vPosition: POSITION,
float4 out vColor: COLOR)
{
vPosition = mul(float4(aPosition, 1.f), wvp);
vColor = aColor;
}

13 changes: 13 additions & 0 deletions shaders/texture2d_rgba_v.cg
@@ -0,0 +1,13 @@
void main(
float3 position,
float2 texcoord,
float4 color,
column_major uniform float4x4 wvp,
float4 out vPosition : POSITION,
float2 out vTexcoord : TEXCOORD0,
float4 out vColor : COLOR)
{
vPosition = mul(float4(position, 1.f), wvp);
vTexcoord = texcoord;
vColor = color;
}
10 changes: 10 additions & 0 deletions shaders/texture2d_v.cg
@@ -0,0 +1,10 @@
void main(
float3 position,
float2 texcoord,
column_major uniform float4x4 wvp,
float4 out vPosition : POSITION,
float2 out vTexcoord : TEXCOORD0)
{
vPosition = mul(float4(position, 1.f), wvp);
vTexcoord = texcoord;
}
4 changes: 4 additions & 0 deletions shaders/vertex_f.cg
@@ -0,0 +1,4 @@
float4 main(uniform float4 color) : COLOR
{
return color;
}
8 changes: 8 additions & 0 deletions shaders/vertex_v.cg
@@ -0,0 +1,8 @@
void main(
float3 aPosition,
column_major uniform float4x4 wvp,
float4 out vPosition: POSITION)
{
vPosition = mul(float4(aPosition, 1.f), wvp);
}

0 comments on commit 926f1f0

Please sign in to comment.