examples: Stop using img2ds and switch to grit
img2ds is still required for the clear bitmap example because grit doesn't support the clear depth format.
@ -24,7 +24,7 @@ BUILD := build
|
||||
SOURCES := source
|
||||
INCLUDES := include
|
||||
DATA := data
|
||||
GRAPHICS :=
|
||||
GRAPHICS := graphics
|
||||
AUDIO :=
|
||||
ICON :=
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
BINDIRS := data
|
||||
GFXDIRS := graphics
|
||||
|
||||
include ../../Makefile.example.blocksds
|
||||
|
@ -4,18 +4,11 @@ NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
||||
ASSETS=$NITRO_ENGINE/examples/assets
|
||||
TOOLS=$NITRO_ENGINE/tools
|
||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||
IMG2DS=$TOOLS/img2ds/img2ds.py
|
||||
|
||||
rm -rf data
|
||||
mkdir -p data
|
||||
|
||||
python3 $OBJ2DL \
|
||||
--input $ASSETS/sphere.obj \
|
||||
--output data/sphere.bin \
|
||||
--texture 256 256
|
||||
|
||||
python3 $IMG2DS \
|
||||
--input $ASSETS/teapot.png \
|
||||
--name texture \
|
||||
--output data \
|
||||
--format A1RGB5
|
||||
|
||||
|
2
examples/effects/fog/graphics/texture.grit
Normal file
@ -0,0 +1,2 @@
|
||||
# 16-bit palette, no transparency
|
||||
-gx -gb -gB16 -gT!
|
BIN
examples/effects/fog/graphics/texture.png
Normal file
After Width: | Height: | Size: 100 KiB |
@ -6,7 +6,7 @@
|
||||
|
||||
#include <NEMain.h>
|
||||
|
||||
#include "texture_tex_bin.h"
|
||||
#include "texture.h"
|
||||
#include "sphere_bin.h"
|
||||
|
||||
NE_Camera *Camera;
|
||||
@ -60,7 +60,7 @@ int main(void)
|
||||
|
||||
// Load texture
|
||||
NE_MaterialTexLoad(Material, NE_RGB5, 256, 256, NE_TEXGEN_TEXCOORD,
|
||||
(u8 *)texture_tex_bin);
|
||||
textureBitmap);
|
||||
|
||||
// Assign the same material to every model object.
|
||||
NE_ModelSetMaterial(Model, Material);
|
||||
|
@ -24,7 +24,7 @@ BUILD := build
|
||||
SOURCES := source
|
||||
INCLUDES := include
|
||||
DATA := data
|
||||
GRAPHICS :=
|
||||
GRAPHICS := graphics
|
||||
AUDIO :=
|
||||
ICON :=
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
BINDIRS := data
|
||||
GFXDIRS := graphics
|
||||
|
||||
include ../../Makefile.example.blocksds
|
||||
|
@ -4,8 +4,8 @@ NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
||||
ASSETS=$NITRO_ENGINE/examples/assets
|
||||
TOOLS=$NITRO_ENGINE/tools
|
||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||
IMG2DS=$TOOLS/img2ds/img2ds.py
|
||||
|
||||
rm -rf data
|
||||
mkdir -p data
|
||||
|
||||
python3 $OBJ2DL \
|
||||
@ -13,9 +13,3 @@ python3 $OBJ2DL \
|
||||
--output data/teapot.bin \
|
||||
--texture 256 256 \
|
||||
--scale 0.1
|
||||
|
||||
python3 $IMG2DS \
|
||||
--input $ASSETS/teapot.png \
|
||||
--name teapot \
|
||||
--output data \
|
||||
--format A1RGB5
|
||||
|
@ -0,0 +1,2 @@
|
||||
# 16-bit palette, no transparency
|
||||
-gx -gb -gB16 -gT!
|
BIN
examples/effects/shading_alpha_outlining/graphics/teapot.png
Normal file
After Width: | Height: | Size: 100 KiB |
@ -7,7 +7,7 @@
|
||||
#include <NEMain.h>
|
||||
|
||||
#include "teapot_bin.h"
|
||||
#include "teapot_tex_bin.h"
|
||||
#include "teapot.h"
|
||||
|
||||
NE_Camera *Camera;
|
||||
NE_Model *Model;
|
||||
@ -58,7 +58,7 @@ int main(void)
|
||||
// Load teapot from RAM and assign it to a material
|
||||
NE_MaterialTexLoad(Material, NE_RGB5, 256, 256,
|
||||
NE_TEXGEN_TEXCOORD | NE_TEXTURE_WRAP_S | NE_TEXTURE_WRAP_T,
|
||||
(u8 *)teapot_tex_bin);
|
||||
teapotBitmap);
|
||||
|
||||
// Assign material to the model
|
||||
NE_ModelSetMaterial(Model, Material);
|
||||
|
@ -24,7 +24,7 @@ BUILD := build
|
||||
SOURCES := source
|
||||
INCLUDES := include
|
||||
DATA := data
|
||||
GRAPHICS :=
|
||||
GRAPHICS := graphics
|
||||
AUDIO :=
|
||||
ICON :=
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
BINDIRS := data
|
||||
GFXDIRS := graphics
|
||||
|
||||
include ../../Makefile.example.blocksds
|
||||
|
@ -4,8 +4,8 @@ NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
||||
ASSETS=$NITRO_ENGINE/examples/assets
|
||||
TOOLS=$NITRO_ENGINE/tools
|
||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||
IMG2DS=$TOOLS/img2ds/img2ds.py
|
||||
|
||||
rm -rf data
|
||||
mkdir -p data
|
||||
|
||||
python3 $OBJ2DL \
|
||||
@ -13,9 +13,3 @@ python3 $OBJ2DL \
|
||||
--output data/teapot.bin \
|
||||
--texture 256 256 \
|
||||
--scale 0.1
|
||||
|
||||
python3 $IMG2DS \
|
||||
--input $ASSETS/teapot.png \
|
||||
--name teapot \
|
||||
--output data \
|
||||
--format A1RGB5
|
||||
|
2
examples/effects/specular_material/graphics/teapot.grit
Normal file
@ -0,0 +1,2 @@
|
||||
# 16-bit palette, no transparency
|
||||
-gx -gb -gB16 -gT!
|
BIN
examples/effects/specular_material/graphics/teapot.png
Normal file
After Width: | Height: | Size: 100 KiB |
@ -6,9 +6,9 @@
|
||||
|
||||
#include <NEMain.h>
|
||||
|
||||
// Files autogenerated from bin files inside of the folder data
|
||||
// Files autogenerated from bin files inside of the data and graphics folders.
|
||||
#include "teapot_bin.h"
|
||||
#include "teapot_tex_bin.h"
|
||||
#include "teapot.h"
|
||||
|
||||
NE_Camera *Camera;
|
||||
NE_Model *ModelSpecular, *ModelDiffuse;
|
||||
@ -70,7 +70,7 @@ int main(void)
|
||||
// outside of [0.0, 1.0], so it is needed to enable wrapping.
|
||||
NE_MaterialTexLoad(MaterialSpecular, NE_A1RGB5, 256, 256,
|
||||
NE_TEXGEN_TEXCOORD | NE_TEXTURE_WRAP_S | NE_TEXTURE_WRAP_T,
|
||||
(u8 *)teapot_tex_bin);
|
||||
teapotBitmap);
|
||||
NE_MaterialClone(MaterialSpecular, MaterialDiffuse);
|
||||
|
||||
NE_ModelSetMaterial(ModelSpecular, MaterialSpecular);
|
||||
|
@ -24,7 +24,7 @@ BUILD := build
|
||||
SOURCES := source
|
||||
INCLUDES := include
|
||||
DATA := data
|
||||
GRAPHICS :=
|
||||
GRAPHICS := graphics
|
||||
AUDIO :=
|
||||
ICON :=
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
BINDIRS := data
|
||||
GFXDIRS := graphics
|
||||
|
||||
include ../../Makefile.example.blocksds
|
||||
|
@ -4,8 +4,8 @@ NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
||||
ASSETS=$NITRO_ENGINE/examples/assets
|
||||
TOOLS=$NITRO_ENGINE/tools
|
||||
MD5_TO_DSMA=$TOOLS/md5_to_dsma/md5_to_dsma.py
|
||||
IMG2DS=$TOOLS/img2ds/img2ds.py
|
||||
|
||||
rm -rf data
|
||||
mkdir -p data
|
||||
|
||||
python3 $MD5_TO_DSMA \
|
||||
@ -17,9 +17,3 @@ python3 $MD5_TO_DSMA \
|
||||
--skip-frames 1 \
|
||||
--bin \
|
||||
--blender-fix
|
||||
|
||||
python3 $IMG2DS \
|
||||
--input $ASSETS/teapot.png \
|
||||
--name texture \
|
||||
--output data \
|
||||
--format A1RGB5
|
||||
|
2
examples/loading/animated_model/graphics/texture.grit
Normal file
@ -0,0 +1,2 @@
|
||||
# 16 bit texture bitmap, force alpha bit to 1
|
||||
-gx -gb -gB16 -gT!
|
BIN
examples/loading/animated_model/graphics/texture.png
Normal file
After Width: | Height: | Size: 100 KiB |
@ -8,7 +8,7 @@
|
||||
|
||||
#include "robot_dsm_bin.h"
|
||||
#include "robot_wave_dsa_bin.h"
|
||||
#include "texture_tex_bin.h"
|
||||
#include "texture.h"
|
||||
|
||||
NE_Camera *Camera;
|
||||
NE_Model *Model;
|
||||
@ -49,7 +49,7 @@ int main(void)
|
||||
|
||||
Texture = NE_MaterialCreate();
|
||||
NE_MaterialTexLoad(Texture, NE_A1RGB5, 256, 256, NE_TEXGEN_TEXCOORD,
|
||||
(void *)texture_tex_bin);
|
||||
textureBitmap);
|
||||
|
||||
NE_ModelSetMaterial(Model, Texture);
|
||||
|
||||
|
@ -4,8 +4,9 @@ NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
||||
ASSETS=$NITRO_ENGINE/examples/assets
|
||||
TOOLS=$NITRO_ENGINE/tools
|
||||
MD5_TO_DSMA=$TOOLS/md5_to_dsma/md5_to_dsma.py
|
||||
IMG2DS=$TOOLS/img2ds/img2ds.py
|
||||
GRIT=grit
|
||||
|
||||
rm -rf nitrofiles
|
||||
mkdir -p nitrofiles
|
||||
|
||||
python3 $MD5_TO_DSMA \
|
||||
@ -17,8 +18,7 @@ python3 $MD5_TO_DSMA \
|
||||
--skip-frames 1 \
|
||||
--blender-fix
|
||||
|
||||
python3 $IMG2DS \
|
||||
--input $ASSETS/teapot.png \
|
||||
--name texture \
|
||||
--output nitrofiles \
|
||||
--format A1RGB5
|
||||
$GRIT \
|
||||
graphics/texture.png \
|
||||
-ftb -fh! -W1 \
|
||||
-onitrofiles/texture
|
||||
|
@ -0,0 +1,2 @@
|
||||
# 16 bit texture bitmap, force alpha bit to 1
|
||||
-gx -gb -gB16 -gT!
|
BIN
examples/loading/filesystem_animated_model/graphics/texture.png
Normal file
After Width: | Height: | Size: 100 KiB |
@ -0,0 +1,25 @@
|
||||
|
||||
//{{BLOCK(texture)
|
||||
|
||||
//======================================================================
|
||||
//
|
||||
// texture, 256x256@16,
|
||||
// Alphabit on.
|
||||
// + bitmap not compressed
|
||||
// Total size: 131072 = 131072
|
||||
//
|
||||
// Time-stamp: 2024-01-27, 18:07:12
|
||||
// Exported by Cearn's GBA Image Transmogrifier, v0.9.2
|
||||
// ( http://www.coranac.com/projects/#grit )
|
||||
//
|
||||
//======================================================================
|
||||
|
||||
#ifndef GRIT_TEXTURE_H
|
||||
#define GRIT_TEXTURE_H
|
||||
|
||||
#define textureBitmapLen 131072
|
||||
extern const unsigned int textureBitmap[32768];
|
||||
|
||||
#endif // GRIT_TEXTURE_H
|
||||
|
||||
//}}BLOCK(texture)
|
@ -81,7 +81,7 @@ int main(void)
|
||||
}
|
||||
|
||||
if (NE_MaterialTexLoadFAT(Material, NE_A1RGB5, 256, 256, NE_TEXGEN_TEXCOORD,
|
||||
"texture_tex.bin") == 0)
|
||||
"texture.img.bin") == 0)
|
||||
{
|
||||
printf("Couldn't load texture...");
|
||||
WaitLoop();
|
||||
|
@ -3,9 +3,10 @@
|
||||
NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
||||
ASSETS=$NITRO_ENGINE/examples/assets
|
||||
TOOLS=$NITRO_ENGINE/tools
|
||||
IMG2DS=$TOOLS/img2ds/img2ds.py
|
||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||
GRIT=grit
|
||||
|
||||
rm -rf nitrofiles
|
||||
mkdir -p nitrofiles
|
||||
|
||||
python3 $OBJ2DL \
|
||||
@ -13,14 +14,12 @@ python3 $OBJ2DL \
|
||||
--output nitrofiles/cube.bin \
|
||||
--texture 64 64
|
||||
|
||||
python3 $IMG2DS \
|
||||
--input $ASSETS/spiral_blue_pal32.png \
|
||||
--name spiral_blue_pal32 \
|
||||
--output nitrofiles \
|
||||
--format A3PAL32
|
||||
$GRIT \
|
||||
graphics/spiral_blue_pal32.png \
|
||||
-ftb -fh! -W1 \
|
||||
-onitrofiles/spiral_blue_pal32
|
||||
|
||||
python3 $IMG2DS \
|
||||
--input $ASSETS/spiral_red_pal32.png \
|
||||
--name spiral_red_pal32 \
|
||||
--output nitrofiles \
|
||||
--format A3PAL32
|
||||
$GRIT \
|
||||
graphics/spiral_red_pal32.png \
|
||||
-ftb -fh! -W1 \
|
||||
-onitrofiles/spiral_red_pal32
|
||||
|
@ -0,0 +1,2 @@
|
||||
# 3 bits of alpha, 5 bits of color index
|
||||
-gx -gb -gBa3i5 -gT!
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
@ -0,0 +1,2 @@
|
||||
# 3 bits of alpha, 5 bits of color index
|
||||
-gx -gb -gBa3i5 -gT!
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
@ -1 +0,0 @@
|
||||
,$08<<@@4(8DH@D<@D4
|
@ -65,12 +65,12 @@ int main(void)
|
||||
NE_ModelLoadStaticMeshFAT(Model, "cube.bin");
|
||||
|
||||
NE_MaterialTexLoadFAT(MaterialBlue, NE_A3PAL32, 64, 64, NE_TEXGEN_TEXCOORD,
|
||||
"spiral_blue_pal32_tex.bin");
|
||||
"spiral_blue_pal32.img.bin");
|
||||
NE_MaterialTexLoadFAT(MaterialRed, NE_A3PAL32, 64, 64, NE_TEXGEN_TEXCOORD,
|
||||
"spiral_red_pal32_tex.bin");
|
||||
"spiral_red_pal32.img.bin");
|
||||
|
||||
NE_PaletteLoadFAT(PaletteBlue, "spiral_blue_pal32_pal.bin", NE_A3PAL32);
|
||||
NE_PaletteLoadFAT(PaletteRed, "spiral_red_pal32_pal.bin", NE_A3PAL32);
|
||||
NE_PaletteLoadFAT(PaletteBlue, "spiral_blue_pal32.pal.bin", NE_A3PAL32);
|
||||
NE_PaletteLoadFAT(PaletteRed, "spiral_red_pal32.pal.bin", NE_A3PAL32);
|
||||
|
||||
NE_MaterialSetPalette(MaterialBlue, PaletteBlue);
|
||||
NE_MaterialSetPalette(MaterialRed, PaletteRed);
|
||||
|
@ -4,8 +4,9 @@ NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
||||
ASSETS=$NITRO_ENGINE/examples/assets
|
||||
TOOLS=$NITRO_ENGINE/tools
|
||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||
IMG2DS=$TOOLS/img2ds/img2ds.py
|
||||
GRIT=grit
|
||||
|
||||
rm -rf nitrofiles
|
||||
mkdir -p nitrofiles
|
||||
|
||||
python3 $OBJ2DL \
|
||||
@ -13,8 +14,7 @@ python3 $OBJ2DL \
|
||||
--output nitrofiles/robot.bin \
|
||||
--texture 256 256
|
||||
|
||||
python3 $IMG2DS \
|
||||
--input $ASSETS/teapot.png \
|
||||
--name texture \
|
||||
--output nitrofiles \
|
||||
--format A1RGB5
|
||||
$GRIT \
|
||||
graphics/texture.png \
|
||||
-ftb -fh! -W1 \
|
||||
-onitrofiles/texture
|
||||
|
@ -0,0 +1,2 @@
|
||||
# 16 bit texture bitmap, force alpha bit to 1
|
||||
-gx -gb -gB16 -gT!
|
BIN
examples/loading/filesystem_simple_model/graphics/texture.png
Normal file
After Width: | Height: | Size: 100 KiB |
@ -0,0 +1,25 @@
|
||||
|
||||
//{{BLOCK(texture)
|
||||
|
||||
//======================================================================
|
||||
//
|
||||
// texture, 256x256@16,
|
||||
// Alphabit on.
|
||||
// + bitmap not compressed
|
||||
// Total size: 131072 = 131072
|
||||
//
|
||||
// Time-stamp: 2024-01-27, 18:13:28
|
||||
// Exported by Cearn's GBA Image Transmogrifier, v0.9.2
|
||||
// ( http://www.coranac.com/projects/#grit )
|
||||
//
|
||||
//======================================================================
|
||||
|
||||
#ifndef GRIT_TEXTURE_H
|
||||
#define GRIT_TEXTURE_H
|
||||
|
||||
#define textureBitmapLen 131072
|
||||
extern const unsigned int textureBitmap[32768];
|
||||
|
||||
#endif // GRIT_TEXTURE_H
|
||||
|
||||
//}}BLOCK(texture)
|
@ -62,7 +62,7 @@ int main(void)
|
||||
NE_ModelLoadStaticMeshFAT(Model, "robot.bin");
|
||||
// Load a RGB texture from RAM and assign it to "Material".
|
||||
NE_MaterialTexLoadFAT(Material, NE_RGB5, 256, 256, NE_TEXGEN_TEXCOORD,
|
||||
"texture_tex.bin");
|
||||
"texture.img.bin");
|
||||
|
||||
// Assign texture to model...
|
||||
NE_ModelSetMaterial(Model, Material);
|
||||
|
@ -23,8 +23,8 @@ TARGET := $(shell basename $(CURDIR))
|
||||
BUILD := build
|
||||
SOURCES := source
|
||||
INCLUDES := include
|
||||
DATA := data
|
||||
GRAPHICS :=
|
||||
DATA :=
|
||||
GRAPHICS := graphics
|
||||
AUDIO :=
|
||||
ICON :=
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
BINDIRS := data
|
||||
GFXDIRS := graphics
|
||||
|
||||
include ../../Makefile.example.blocksds
|
||||
|
@ -1,19 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
||||
TOOLS=$NITRO_ENGINE/tools
|
||||
IMG2DS=$TOOLS/img2ds/img2ds.py
|
||||
|
||||
mkdir -p data
|
||||
|
||||
python3 $IMG2DS \
|
||||
--input assets/a3pal32.png \
|
||||
--name a3pal32 \
|
||||
--output data \
|
||||
--format A3PAL32
|
||||
|
||||
python3 $IMG2DS \
|
||||
--input assets/pal4.png \
|
||||
--name pal4 \
|
||||
--output data \
|
||||
--format PAL4
|
@ -1 +0,0 @@
|
||||
<EFBFBD><05><03>Aj\
|
@ -0,0 +1,2 @@
|
||||
# 3 bits of alpha, 5 bits of color index
|
||||
-gx -gb -gBa3i5 -gT!
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
2
examples/loading/incomplete_texture/graphics/pal4.grit
Normal file
@ -0,0 +1,2 @@
|
||||
# 4 color palette
|
||||
-gx -gb -gB2 -gTFF00FF
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@ -6,10 +6,8 @@
|
||||
|
||||
#include <NEMain.h>
|
||||
|
||||
#include "a3pal32_pal_bin.h"
|
||||
#include "a3pal32_tex_bin.h"
|
||||
#include "pal4_pal_bin.h"
|
||||
#include "pal4_tex_bin.h"
|
||||
#include "a3pal32.h"
|
||||
#include "pal4.h"
|
||||
|
||||
NE_Material *Material, *Material2;
|
||||
NE_Palette *Palette, *Palette2;
|
||||
@ -59,8 +57,8 @@ int main(void)
|
||||
NE_MaterialTexLoad(Material,
|
||||
NE_A3PAL32, // Texture type
|
||||
64, 200, // Width, height (in pixels)
|
||||
NE_TEXGEN_TEXCOORD, (u8 *)a3pal32_tex_bin);
|
||||
NE_PaletteLoad(Palette, (u16 *)a3pal32_pal_bin, 32, NE_A3PAL32);
|
||||
NE_TEXGEN_TEXCOORD, a3pal32Bitmap);
|
||||
NE_PaletteLoad(Palette, a3pal32Pal, 32, NE_A3PAL32);
|
||||
NE_MaterialSetPalette(Material, Palette);
|
||||
|
||||
// Allocate objects for another material
|
||||
@ -68,8 +66,8 @@ int main(void)
|
||||
Palette2 = NE_PaletteCreate();
|
||||
|
||||
NE_MaterialTexLoad(Material2, NE_PAL4, 64, 100, NE_TEXGEN_TEXCOORD,
|
||||
(u8 *)pal4_tex_bin);
|
||||
NE_PaletteLoad(Palette2, (u16 *)pal4_pal_bin, 4, NE_PAL4);
|
||||
pal4Bitmap);
|
||||
NE_PaletteLoad(Palette2, pal4Pal, 4, NE_PAL4);
|
||||
NE_MaterialSetPalette(Material2, Palette2);
|
||||
|
||||
while (1)
|
||||
|
@ -24,7 +24,7 @@ BUILD := build
|
||||
SOURCES := source
|
||||
INCLUDES := include
|
||||
DATA := data
|
||||
GRAPHICS :=
|
||||
GRAPHICS := graphics
|
||||
AUDIO :=
|
||||
ICON :=
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
BINDIRS := data
|
||||
GFXDIRS := graphics
|
||||
|
||||
include ../../Makefile.example.blocksds
|
||||
|
@ -4,8 +4,8 @@ NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
||||
ASSETS=$NITRO_ENGINE/examples/assets
|
||||
TOOLS=$NITRO_ENGINE/tools
|
||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||
IMG2DS=$TOOLS/img2ds/img2ds.py
|
||||
|
||||
rm -rf data
|
||||
mkdir -p data
|
||||
|
||||
python3 $OBJ2DL \
|
||||
@ -13,9 +13,3 @@ python3 $OBJ2DL \
|
||||
--output data/sphere_vertex_colors.bin \
|
||||
--texture 256 256 \
|
||||
--use-vertex-color
|
||||
|
||||
python3 $IMG2DS \
|
||||
--input $ASSETS/teapot.png \
|
||||
--name texture \
|
||||
--output data \
|
||||
--format A1RGB5
|
||||
|
@ -0,0 +1,2 @@
|
||||
# 16 bit texture bitmap, force alpha bit to 1
|
||||
-gx -gb -gB16 -gT!
|
BIN
examples/loading/model_with_vertex_color/graphics/texture.png
Normal file
After Width: | Height: | Size: 100 KiB |
@ -7,7 +7,7 @@
|
||||
#include <NEMain.h>
|
||||
|
||||
#include "sphere_vertex_colors_bin.h"
|
||||
#include "texture_tex_bin.h"
|
||||
#include "texture.h"
|
||||
|
||||
NE_Camera *Camera;
|
||||
NE_Model *Model;
|
||||
@ -48,7 +48,7 @@ int main(void)
|
||||
NE_ModelLoadStaticMesh(Model, (u32 *)sphere_vertex_colors_bin);
|
||||
// Load a RGB texture from RAM and assign it to "Material".
|
||||
NE_MaterialTexLoad(Material, NE_RGB5, 256, 256, NE_TEXGEN_TEXCOORD,
|
||||
(u8 *)texture_tex_bin);
|
||||
textureBitmap);
|
||||
|
||||
// Assign texture to model...
|
||||
NE_ModelSetMaterial(Model, Material);
|
||||
|
@ -23,8 +23,8 @@ TARGET := $(shell basename $(CURDIR))
|
||||
BUILD := build
|
||||
SOURCES := source
|
||||
INCLUDES := include
|
||||
DATA := data
|
||||
GRAPHICS :=
|
||||
DATA :=
|
||||
GRAPHICS := graphics
|
||||
AUDIO :=
|
||||
ICON :=
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
BINDIRS := data
|
||||
GFXDIRS := graphics
|
||||
|
||||
include ../../Makefile.example.blocksds
|
||||
|
@ -1,20 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
||||
ASSETS=$NITRO_ENGINE/examples/assets
|
||||
TOOLS=$NITRO_ENGINE/tools
|
||||
IMG2DS=$TOOLS/img2ds/img2ds.py
|
||||
|
||||
mkdir -p data
|
||||
|
||||
python3 $IMG2DS \
|
||||
--input $ASSETS/a3pal32.png \
|
||||
--name a3pal32 \
|
||||
--output data \
|
||||
--format A3PAL32
|
||||
|
||||
python3 $IMG2DS \
|
||||
--input $ASSETS/a5pal8.png \
|
||||
--name a5pal8 \
|
||||
--output data \
|
||||
--format A5PAL8
|
@ -1 +0,0 @@
|
||||
ÝË¿Â!Ý I<fd
|
2
examples/loading/paletted_texture/graphics/a3pal32.grit
Normal file
@ -0,0 +1,2 @@
|
||||
# 3 bits of alpha, 5 bits of color index
|
||||
-gx -gb -gBa3i5 -gT!
|
BIN
examples/loading/paletted_texture/graphics/a3pal32.png
Normal file
After Width: | Height: | Size: 42 KiB |
2
examples/loading/paletted_texture/graphics/a5pal8.grit
Normal file
@ -0,0 +1,2 @@
|
||||
# 5 bits of alpha, 3 bits of color index
|
||||
-gx -gb -gBa5i3 -gT!
|
BIN
examples/loading/paletted_texture/graphics/a5pal8.png
Normal file
After Width: | Height: | Size: 39 KiB |
@ -6,11 +6,8 @@
|
||||
|
||||
#include <NEMain.h>
|
||||
|
||||
#include "a5pal8_tex_bin.h"
|
||||
#include "a5pal8_pal_bin.h"
|
||||
|
||||
#include "a3pal32_tex_bin.h"
|
||||
#include "a3pal32_pal_bin.h"
|
||||
#include "a5pal8.h"
|
||||
#include "a3pal32.h"
|
||||
|
||||
NE_Material *Material1, *Material2;
|
||||
NE_Palette *Palette1, *Palette2;
|
||||
@ -51,14 +48,14 @@ int main(void)
|
||||
// Load part of the texture ignoring some of its height. You can't do
|
||||
// this with width because of how textures are laid out in VRAM.
|
||||
NE_MaterialTexLoad(Material1, NE_A3PAL32, 256, 192, NE_TEXGEN_TEXCOORD,
|
||||
(u8 *)a3pal32_tex_bin);
|
||||
a3pal32Bitmap);
|
||||
|
||||
// Load complete texture
|
||||
NE_MaterialTexLoad(Material2, NE_A5PAL8, 256, 256, NE_TEXGEN_TEXCOORD,
|
||||
(u8 *)a5pal8_tex_bin);
|
||||
a5pal8Bitmap);
|
||||
|
||||
NE_PaletteLoad(Palette1, (u16 *)a3pal32_pal_bin, 32, NE_A3PAL32);
|
||||
NE_PaletteLoad(Palette2, (u16 *)a5pal8_pal_bin, 32, NE_A5PAL8);
|
||||
NE_PaletteLoad(Palette1, a3pal32Pal, 32, NE_A3PAL32);
|
||||
NE_PaletteLoad(Palette2, a5pal8Pal, 32, NE_A5PAL8);
|
||||
|
||||
NE_MaterialSetPalette(Material1, Palette1);
|
||||
NE_MaterialSetPalette(Material2, Palette2);
|
||||
|
@ -24,7 +24,7 @@ BUILD := build
|
||||
SOURCES := source
|
||||
INCLUDES := include
|
||||
DATA := data
|
||||
GRAPHICS :=
|
||||
GRAPHICS := graphics
|
||||
AUDIO :=
|
||||
ICON :=
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
BINDIRS := data
|
||||
GFXDIRS := graphics
|
||||
|
||||
include ../../Makefile.example.blocksds
|
||||
|
@ -4,17 +4,11 @@ NITRO_ENGINE=$DEVKITPRO/nitro-engine
|
||||
ASSETS=$NITRO_ENGINE/examples/assets
|
||||
TOOLS=$NITRO_ENGINE/tools
|
||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||
IMG2DS=$TOOLS/img2ds/img2ds.py
|
||||
|
||||
rm -rf data
|
||||
mkdir -p data
|
||||
|
||||
python3 $OBJ2DL \
|
||||
--input $ASSETS/robot/robot.obj \
|
||||
--output data/robot.bin \
|
||||
--texture 256 256
|
||||
|
||||
python3 $IMG2DS \
|
||||
--input $ASSETS/teapot.png \
|
||||
--name texture \
|
||||
--output data \
|
||||
--format A1RGB5
|
||||
|
2
examples/loading/simple_model/graphics/texture.grit
Normal file
@ -0,0 +1,2 @@
|
||||
# 16-bit palette, no transparency
|
||||
-gx -gb -gB16 -gT!
|
BIN
examples/loading/simple_model/graphics/texture.png
Normal file
After Width: | Height: | Size: 100 KiB |
@ -17,7 +17,7 @@
|
||||
// NE_ModelLoadStaticMesh(Model, (u32 *)binfilename_bin);
|
||||
//
|
||||
#include "robot_bin.h"
|
||||
#include "texture_tex_bin.h"
|
||||
#include "texture.h"
|
||||
|
||||
NE_Camera *Camera;
|
||||
NE_Model *Model;
|
||||
@ -58,7 +58,7 @@ int main(void)
|
||||
NE_ModelLoadStaticMesh(Model, (u32 *)robot_bin);
|
||||
// Load a RGB texture from RAM and assign it to "Material".
|
||||
NE_MaterialTexLoad(Material, NE_RGB5, 256, 256, NE_TEXGEN_TEXCOORD,
|
||||
(u8 *)texture_tex_bin);
|
||||
textureBitmap);
|
||||
|
||||
// Assign texture to model...
|
||||
NE_ModelSetMaterial(Model, Material);
|
||||
|
@ -24,7 +24,7 @@ BUILD := build
|
||||
SOURCES := source
|
||||
INCLUDES := include
|
||||
DATA := data
|
||||
GRAPHICS :=
|
||||
GRAPHICS := graphics
|
||||
AUDIO :=
|
||||
ICON :=
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
BINDIRS := data
|
||||
GFXDIRS := graphics
|
||||
|
||||
include ../../Makefile.example.blocksds
|
||||
|
@ -5,8 +5,8 @@ ASSETS=$NITRO_ENGINE/examples/assets
|
||||
TOOLS=$NITRO_ENGINE/tools
|
||||
OBJ2DL=$TOOLS/obj2dl/obj2dl.py
|
||||
MD5_TO_DSMA=$TOOLS/md5_to_dsma/md5_to_dsma.py
|
||||
IMG2DS=$TOOLS/img2ds/img2ds.py
|
||||
|
||||
rm -rf data
|
||||
mkdir -p data
|
||||
|
||||
python3 $MD5_TO_DSMA \
|
||||
@ -18,9 +18,3 @@ python3 $MD5_TO_DSMA \
|
||||
--skip-frames 1 \
|
||||
--bin \
|
||||
--blender-fix
|
||||
|
||||
python3 $IMG2DS \
|
||||
--input $ASSETS/teapot.png \
|
||||
--name texture \
|
||||
--output data \
|
||||
--format A1RGB5
|
||||
|
2
examples/other/blended_animations/graphics/texture.grit
Normal file
@ -0,0 +1,2 @@
|
||||
# 16-bit palette, no transparency
|
||||
-gx -gb -gB16 -gT!
|