refactoring + texture projection

This commit is contained in:
Nick Fisher
2025-03-25 09:39:02 +08:00
parent 0cbbc058e0
commit 999b1e613f
33 changed files with 7357 additions and 1168 deletions

View File

@@ -30,7 +30,7 @@ static void Log(const char *fmt, ...) {
va_end(args);
}
#define ERROR(fmt, ...) Log("Error: %s:%d " fmt, __FILENAME__, __LINE__, ##__VA_ARGS__)
#ifdef ENABLE_TRACING
#ifdef __ANDROID__
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)

View File

@@ -20,7 +20,8 @@ EMSCRIPTEN_KEEPALIVE void Renderer_readPixels(
TRenderTarget *tRenderTarget,
TPixelDataFormat tPixelBufferFormat,
TPixelDataType tPixelDataType,
uint8_t *out
uint8_t *out,
size_t outLength
);
EMSCRIPTEN_KEEPALIVE void Renderer_setFrameInterval(
TRenderer *tRenderer,

View File

@@ -64,6 +64,7 @@ EMSCRIPTEN_KEEPALIVE bool View_isStencilBufferEnabled(TView *tView);
EMSCRIPTEN_KEEPALIVE void View_setDitheringEnabled(TView *tView, bool enabled);
EMSCRIPTEN_KEEPALIVE bool View_isDitheringEnabled(TView *tView);
EMSCRIPTEN_KEEPALIVE void View_setScene(TView *tView, TScene *tScene);
EMSCRIPTEN_KEEPALIVE void View_setFrontFaceWindingInverted(TView *tView, bool inverted);
typedef void (*PickCallback)(uint32_t requestId, EntityId entityId, float depth, float fragX, float fragY, float fragZ);
EMSCRIPTEN_KEEPALIVE void View_pick(TView* tView, uint32_t requestId, uint32_t x, uint32_t y, PickCallback callback);

View File

@@ -77,6 +77,7 @@ namespace thermion
TPixelDataFormat tPixelBufferFormat,
TPixelDataType tPixelDataType,
uint8_t *out,
size_t outLength,
void (*onComplete)());
EMSCRIPTEN_KEEPALIVE void Material_createInstanceRenderThread(TMaterial *tMaterial, void (*onComplete)(TMaterialInstance *));

View File

@@ -0,0 +1,12 @@
.global CAPTURE_UV_CAPTURE_UV_OFFSET;
.global CAPTURE_UV_CAPTURE_UV_SIZE;
.global CAPTURE_UV_PACKAGE
.section .rodata
CAPTURE_UV_PACKAGE:
.incbin "capture_uv.bin"
CAPTURE_UV_CAPTURE_UV_OFFSET:
.int 0
CAPTURE_UV_CAPTURE_UV_SIZE:
.int 125851

View File

@@ -0,0 +1,12 @@
.global _CAPTURE_UV_CAPTURE_UV_OFFSET;
.global _CAPTURE_UV_CAPTURE_UV_SIZE;
.global _CAPTURE_UV_PACKAGE
.section __TEXT,__const
_CAPTURE_UV_PACKAGE:
.incbin "capture_uv.bin"
_CAPTURE_UV_CAPTURE_UV_OFFSET:
.int 0
_CAPTURE_UV_CAPTURE_UV_SIZE:
.int 125851

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
#ifndef CAPTURE_UV_H_
#define CAPTURE_UV_H_
#include <stdint.h>
extern "C" {
extern const uint8_t CAPTURE_UV_PACKAGE[];
extern int CAPTURE_UV_CAPTURE_UV_OFFSET;
extern int CAPTURE_UV_CAPTURE_UV_SIZE;
}
#define CAPTURE_UV_CAPTURE_UV_DATA (CAPTURE_UV_PACKAGE + CAPTURE_UV_CAPTURE_UV_OFFSET)
#endif

View File

@@ -51,7 +51,7 @@ const uint8_t UNLIT_PACKAGE[] = {
0x53, 0x45, 0x54, 0x44, 0x5f, 0x54, 0x41, 0x4d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x54, 0x53, 0x4e, 0x49, 0x5f, 0x54, 0x41,
0x4d, 0x01, 0x00, 0x00, 0x00, 0x00, 0x53, 0x43, 0x32, 0x41, 0x5f, 0x54, 0x41, 0x4d, 0x01, 0x00, 0x00, 0x00, 0x00, 0x4f,
0x43, 0x32, 0x41, 0x5f, 0x54, 0x41, 0x4d, 0x01, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x4d, 0x55, 0x43, 0x5f, 0x54, 0x41, 0x4d,
0x01, 0x00, 0x00, 0x00, 0x02, 0x50, 0x4f, 0x52, 0x50, 0x5f, 0x54, 0x41, 0x4d, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x50, 0x4f, 0x52, 0x50, 0x5f, 0x54, 0x41, 0x4d, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x45, 0x54, 0x53, 0x5f, 0x54, 0x41, 0x4d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x44, 0x49,
0x55, 0x55, 0x5f, 0x54, 0x41, 0x4d, 0x08, 0x00, 0x00, 0x00, 0xf7, 0xaa, 0x19, 0x69, 0x9f, 0xc0, 0xf1, 0x29, 0x44, 0x41,
0x48, 0x53, 0x5f, 0x54, 0x41, 0x4d, 0x01, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x4d, 0x48, 0x53, 0x5f, 0x54, 0x41, 0x4d, 0x01,