feat: add grid material

This commit is contained in:
Nick Fisher
2024-09-05 22:19:27 +08:00
parent d17cce2ca4
commit e45cc0267f
7 changed files with 1563 additions and 1 deletions

View File

@@ -26,10 +26,14 @@ materials: FORCE
$(FILAMENT_PATH)/resgen -c -p image -x thermion_dart/native/include/material/ materials/image.filamat
$(FILAMENT_PATH)/matc -a opengl -a metal -o materials/gizmo.filamat materials/gizmo.mat
$(FILAMENT_PATH)/resgen -c -p gizmo -x thermion_dart/native/include/material/ materials/gizmo.filamat
${FILAMENT_PATH}/matc -a opengl -a metal -o materials/grid.filamat materials/grid.mat
$(FILAMENT_PATH)/resgen -c -p grid -x thermion_dart/native/include/material/ materials/grid.filamat
echo '#include "gizmo.h"' | cat - thermion_dart/native/include/material/gizmo.c > thermion_dart/native/include/material/gizmo.c.new
echo '#include "image.h"' | cat - thermion_dart/native/include/material/image.c > thermion_dart/native/include/material/image.c.new
echo '#include "grid.h"' | cat - thermion_dart/native/include/material/grid.c > thermion_dart/native/include/material/grid.c.new
mv thermion_dart/native/include/material/image.c.new thermion_dart/native/include/material/image.c
mv thermion_dart/native/include/material/gizmo.c.new thermion_dart/native/include/material/gizmo.c
mv thermion_dart/native/include/material/grid.c.new thermion_dart/native/include/material/grid.c
#rm materials/*.filamat

View File

@@ -60,6 +60,7 @@ void main(List<String> args) async {
sources.addAll([
"${config.packageRoot.toFilePath()}/native/include/material/gizmo.c",
"${config.packageRoot.toFilePath()}/native/include/material/image.c",
"${config.packageRoot.toFilePath()}/native/include/material/grid.c",
]);
var libs = [
@@ -76,7 +77,6 @@ void main(List<String> args) async {
"image",
"imageio",
"tinyexr",
"gltfio_core",
"filaflat",
"dracodec",
"ibl",

View File

@@ -0,0 +1,12 @@
.global GRID_GRID_OFFSET;
.global GRID_GRID_SIZE;
.global GRID_PACKAGE
.section .rodata
GRID_PACKAGE:
.incbin "grid.bin"
GRID_GRID_OFFSET:
.int 0
GRID_GRID_SIZE:
.int 30210

View File

@@ -0,0 +1,12 @@
.global _GRID_GRID_OFFSET;
.global _GRID_GRID_SIZE;
.global _GRID_PACKAGE
.section __TEXT,__const
_GRID_PACKAGE:
.incbin "grid.bin"
_GRID_GRID_OFFSET:
.int 0
_GRID_GRID_SIZE:
.int 30210

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
#ifndef GRID_H_
#define GRID_H_
#include <stdint.h>
extern "C" {
extern const uint8_t GRID_PACKAGE[];
extern int GRID_GRID_OFFSET;
extern int GRID_GRID_SIZE;
}
#define GRID_GRID_DATA (GRID_PACKAGE + GRID_GRID_OFFSET)
#endif