Skip to content

Commit d44e871

Browse files
authored
Merge pull request #83 from rust3ds/feat/textures
Implement textures
2 parents 3ffefd8 + 8b101a8 commit d44e871

24 files changed

+2479
-899
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ jobs:
3030
with:
3131
toolchain: ${{ matrix.toolchain }}
3232

33+
- name: Install Clang
34+
run: sudo apt-get update && sudo apt-get install -y clang
35+
3336
# https://github.com/actions/runner/issues/504
3437
# Removing the matchers won't keep the job from failing if there are errors,
3538
# but will at least declutter pull request annotations (especially for warnings).
@@ -63,27 +66,11 @@ jobs:
6366
with:
6467
toolchain: ${{ matrix.toolchain }}
6568

69+
- name: Install Clang
70+
run: sudo apt-get update && sudo apt-get install -y clang
71+
6672
- name: Hide duplicated warnings from lint job
6773
run: echo "::remove-matcher owner=clippy::"
6874

6975
- name: Build and run macro tests
7076
run: cargo test --package citro3d-macros
71-
72-
- name: Build and run lib and integration tests
73-
uses: rust3ds/test-runner/run-tests@v1
74-
with:
75-
args: --tests --package citro3d
76-
77-
- name: Build and run doc tests
78-
uses: rust3ds/test-runner/run-tests@v1
79-
with:
80-
args: --doc --package citro3d
81-
82-
- name: Upload citra logs and capture videos
83-
uses: actions/upload-artifact@v4
84-
if: success() || failure() # always run unless the workflow was cancelled
85-
with:
86-
name: citra-logs-${{ matrix.toolchain }}
87-
path: |
88-
target/armv6k-nintendo-3ds/debug/deps/*.txt
89-
target/armv6k-nintendo-3ds/debug/deps/*.webm

.github/workflows/docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ jobs:
1515
- name: Checkout branch
1616
uses: actions/checkout@v4
1717

18+
- name: Install Clang
19+
run: sudo apt-get update && sudo apt-get install -y clang
20+
1821
- name: Setup Pages
1922
uses: actions/configure-pages@v3
2023

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ rust-toolchain.toml
2323

2424
# Pica200 output files
2525
*.shbin
26+
27+
# Tex3DS output files
28+
*.t3d
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
# Get the asset directory (containing this script)
4+
ASSET_DIR=$(dirname $0)
5+
6+
echo "Kitten"
7+
tex3ds -f auto-etc1 -z auto -o $ASSET_DIR/kitten.t3d $ASSET_DIR/kitten.png
8+
echo "Skybox"
9+
tex3ds -f auto-etc1 --skybox -z auto -o $ASSET_DIR/skybox.t3d $ASSET_DIR/skybox.png

citro3d/examples/assets/kitten.png

15.3 KB
Loading

citro3d/examples/assets/kitten.t3d

2.36 KB
Binary file not shown.

citro3d/examples/assets/skybox.png

599 KB
Loading

citro3d/examples/assets/skybox.t3d

136 KB
Binary file not shown.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
; Example PICA200 vertex shader
2+
3+
; Uniforms
4+
.fvec projection[4], modelView[4]
5+
6+
; Constants
7+
.constf myconst(0.0, 1.0, -1.0, -0.5)
8+
.alias zeros myconst.xxxx ; Vector full of zeros
9+
.alias ones myconst.yyyy ; Vector full of ones
10+
11+
; Outputs
12+
.out outpos position
13+
.out outtc0 texcoord0.st
14+
.out - texcoord0w outtc0.p
15+
16+
; Inputs (defined as aliases for convenience)
17+
.alias inpos v0
18+
19+
.proc main
20+
; Force the w component of inpos to be 1.0
21+
mov r0.xyz, inpos
22+
mov r0.w, ones
23+
24+
; r1 = modelView * inpos
25+
dp4 r1.x, modelView[0], r0
26+
dp4 r1.y, modelView[1], r0
27+
dp4 r1.z, modelView[2], r0
28+
dp4 r1.w, modelView[3], r0
29+
30+
; outpos = projection * r1
31+
dp4 outpos.x, projection[0], r1
32+
dp4 outpos.y, projection[1], r1
33+
dp4 outpos.z, projection[2], r1
34+
dp4 outpos.w, projection[3], r1
35+
36+
; outtc0 = position
37+
mov outtc0, inpos
38+
39+
; We're finished
40+
end
41+
.end
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
; Basic PICA200 vertex shader
2+
3+
; Uniforms
4+
.fvec projection[4]
5+
6+
; Constants
7+
.constf myconst(0.0, 1.0, -1.0, -0.5)
8+
.constf zeros(0.0, 0.0, 0.0, 0.0)
9+
.constf ones(1.0, 1.0, 1.0, 1.0)
10+
11+
; Outputs
12+
.out outpos position
13+
.out outtex texcoord0
14+
15+
; Inputs (defined as aliases for convenience)
16+
.alias inpos v0
17+
.alias intex v1
18+
19+
.proc main
20+
; Force the w component of inpos to be 1.0
21+
mov r0.xyz, inpos
22+
mov r0.w, ones
23+
24+
; outpos = projectionMatrix * inpos
25+
dp4 outpos.x, projection[0], r0
26+
dp4 outpos.y, projection[1], r0
27+
dp4 outpos.z, projection[2], r0
28+
dp4 outpos.w, projection[3], r0
29+
30+
; outtex = intex
31+
mov outtex, intex
32+
33+
; We're finished
34+
end
35+
.end

0 commit comments

Comments
 (0)