example: add elizabeth and speck

This commit is contained in:
Zack Buhman 2025-02-06 08:25:17 -06:00
parent 6c3aba1dc3
commit 058d1d658c
34 changed files with 13390 additions and 39 deletions

391
example/elizabeth.cpp Normal file
View File

@ -0,0 +1,391 @@
#include <stdint.h>
#include "holly/background.hpp"
#include "holly/core.hpp"
#include "holly/core_bits.hpp"
#include "holly/holly.hpp"
#include "holly/isp_tsp.hpp"
#include "holly/region_array.hpp"
#include "holly/ta_bits.hpp"
#include "holly/ta_fifo_polygon_converter.hpp"
#include "holly/ta_global_parameter.hpp"
#include "holly/ta_parameter.hpp"
#include "holly/ta_vertex_parameter.hpp"
#include "holly/texture_memory_alloc3.hpp"
#include "holly/video_output.hpp"
#include "sh7091/serial.hpp"
#include "sh7091/store_queue.hpp"
#include "systembus.hpp"
#include "systembus_bits.hpp"
#include "memory.hpp"
#include "model/model.h"
#include "model/material.h"
#include "model/elizabeth/elizabeth_mat_emissive.data.h"
#include "model/elizabeth/elizabeth_sword_mat_emissive.data.h"
#include "model/elizabeth/material.h"
#include "model/elizabeth/model.h"
using vec3 = vec<3, float>;
using vec2 = vec<2, float>;
const float degree = 0.017453292519943295;
static float theta = 0;
static int frame = 0;
static inline vec3 transform_vertex(const vec3 vec, const vec3 translate)
{
float xm = -vec.x;
float ym = -vec.y;
float zm = vec.z;
float x0 = xm * cos(theta) - zm * sin(theta);
float y0 = ym;
float z0 = xm * sin(theta) + zm * cos(theta);
float x1 = x0 + translate.x;
float y1 = y0 + translate.y;
float z1 = z0 + translate.z;
float x2 = x1;
float y2 = y1 + 1;
float z2 = z1 + 1.2;
float x3 = x2 / z2;
float y3 = y2 / z2;
float z3 = 1.0 / z2;
float x = x3 * 240 + 320;
float y = y3 * 240 + 320 - 50;
float z = z3;
return {x, y, z};
}
static inline vec2 transform_uv(vec2 uv)
{
float x = uv.x;
float y = uv.y;
return {x, y};
}
const uint32_t base_color = 0xa0000000;
static inline void transfer_triangle(const vertex_position * position,
const vertex_texture * texture,
const union triangle * triangle,
const vec3 translate)
{
vec3 v1 = transform_vertex(position[triangle->a.position], translate);
vec2 uv1 = transform_uv(texture[triangle->a.texture]);
*reinterpret_cast<ta_vertex_parameter::polygon_type_3 *>(store_queue) =
ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(false),
v1.x, v1.y, v1.z,
uv1.x, uv1.y,
base_color,
0); // offset_color
sq_transfer_32byte(ta_fifo_polygon_converter);
vec3 v2 = transform_vertex(position[triangle->b.position], translate);
vec2 uv2 = transform_uv(texture[triangle->b.texture]);
*reinterpret_cast<ta_vertex_parameter::polygon_type_3 *>(store_queue) =
ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(false),
v2.x, v2.y, v2.z,
uv2.x, uv2.y,
base_color,
0); // offset_color
sq_transfer_32byte(ta_fifo_polygon_converter);
vec3 v3 = transform_vertex(position[triangle->c.position], translate);
vec2 uv3 = transform_uv(texture[triangle->c.texture]);
*reinterpret_cast<ta_vertex_parameter::polygon_type_3 *>(store_queue) =
ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(true),
v3.x, v3.y, v3.z,
uv3.x, uv3.y,
base_color,
0); // offset_color
sq_transfer_32byte(ta_fifo_polygon_converter);
}
static inline void transfer_quadrilateral(const vertex_position * position,
const vertex_texture * texture,
const union quadrilateral * quadrilateral,
const vec3 translate)
{
vec3 v1 = transform_vertex(position[quadrilateral->a.position], translate);
vec2 uv1 = transform_uv(texture[quadrilateral->a.texture]);
*reinterpret_cast<ta_vertex_parameter::polygon_type_3 *>(store_queue) =
ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(false),
v1.x, v1.y, v1.z,
uv1.x, uv1.y,
base_color,
0); // offset_color
sq_transfer_32byte(ta_fifo_polygon_converter);
vec3 v2 = transform_vertex(position[quadrilateral->b.position], translate);
vec2 uv2 = transform_uv(texture[quadrilateral->b.texture]);
*reinterpret_cast<ta_vertex_parameter::polygon_type_3 *>(store_queue) =
ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(false),
v2.x, v2.y, v2.z,
uv2.x, uv2.y,
base_color,
0); // offset_color
sq_transfer_32byte(ta_fifo_polygon_converter);
vec3 v4 = transform_vertex(position[quadrilateral->d.position], translate);
vec2 uv4 = transform_uv(texture[quadrilateral->d.texture]);
*reinterpret_cast<ta_vertex_parameter::polygon_type_3 *>(store_queue) =
ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(false),
v4.x, v4.y, v4.z,
uv4.x, uv4.y,
base_color,
0); // offset_color
sq_transfer_32byte(ta_fifo_polygon_converter);
vec3 v3 = transform_vertex(position[quadrilateral->c.position], translate);
vec2 uv3 = transform_uv(texture[quadrilateral->c.texture]);
*reinterpret_cast<ta_vertex_parameter::polygon_type_3 *>(store_queue) =
ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(true),
v3.x, v3.y, v3.z,
uv3.x, uv3.y,
base_color,
0); // offset_color
sq_transfer_32byte(ta_fifo_polygon_converter);
}
static inline void transfer_triangles(const struct model * model,
const struct material_descriptor * material,
const struct object * object,
const uint32_t list_type,
const uint32_t blending,
const uint32_t pixel_format,
const vec3 translate)
{
if (object->triangle_count == 0 && object->quadrilateral_count == 0)
return;
const uint32_t parameter_control_word = para_control::para_type::polygon_or_modifier_volume
| list_type
| obj_control::col_type::packed_color
| obj_control::texture;
const uint32_t isp_tsp_instruction_word = isp_tsp_instruction_word::depth_compare_mode::greater
| isp_tsp_instruction_word::culling_mode::no_culling;
const uint32_t tsp_instruction_word = blending
| tsp_instruction_word::fog_control::no_fog;
const uint32_t texture_address = texture_memory_alloc.texture.start + material[object->material].pixel.vram_offset;
const uint32_t texture_control_word = pixel_format
| texture_control_word::scan_order::twiddled
| texture_control_word::texture_address(texture_address / 8);
*reinterpret_cast<ta_global_parameter::polygon_type_0 *>(store_queue) =
ta_global_parameter::polygon_type_0(parameter_control_word,
isp_tsp_instruction_word,
tsp_instruction_word,
texture_control_word,
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
sq_transfer_32byte(ta_fifo_polygon_converter);
for (int i = 0; i < object->triangle_count; i++) {
transfer_triangle(model->position, model->texture, &object->triangle[i], translate);
}
for (int i = 0; i < object->quadrilateral_count; i++) {
transfer_quadrilateral(model->position, model->texture, &object->quadrilateral[i], translate);
}
}
void transfer_scene()
{
const struct model * model = &elizabeth_model;
const struct material_descriptor * material = elizabeth_material;
// opaque
{
const uint32_t list_type = para_control::list_type::opaque;
const uint32_t blending = tsp_instruction_word::src_alpha_instr::one
| tsp_instruction_word::dst_alpha_instr::zero
| tsp_instruction_word::texture_u_size::from_int(128)
| tsp_instruction_word::texture_v_size::from_int(128);
const uint32_t pixel_format = texture_control_word::pixel_format::_1555;
const vec3 translate = {-0.3, -0.2, 0};
transfer_triangles(model, material,
&elizabeth_elizabeth_opaque,
list_type,
blending,
pixel_format, translate);
*reinterpret_cast<ta_global_parameter::end_of_list *>(store_queue) =
ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
sq_transfer_32byte(ta_fifo_polygon_converter);
}
// punch through
{
const uint32_t list_type = para_control::list_type::punch_through;
const uint32_t blending = tsp_instruction_word::src_alpha_instr::src_alpha
| tsp_instruction_word::dst_alpha_instr::inverse_src_alpha
| tsp_instruction_word::texture_u_size::from_int(128)
| tsp_instruction_word::texture_v_size::from_int(128);
const uint32_t pixel_format = texture_control_word::pixel_format::_1555;
const vec3 translate = {-0.3, -0.2, 0};
transfer_triangles(model, material,
&elizabeth_elizabeth_punchthrough,
list_type,
blending,
pixel_format,
translate);
const uint32_t blending_sword = tsp_instruction_word::src_alpha_instr::src_alpha
| tsp_instruction_word::dst_alpha_instr::inverse_src_alpha
| tsp_instruction_word::texture_u_size::from_int(32)
| tsp_instruction_word::texture_v_size::from_int(64);
const vec3 translate_sword = {1, -0.8, 0};
transfer_triangles(model, material,
&elizabeth_elizabeth_sword,
list_type,
blending_sword,
pixel_format,
translate_sword);
*reinterpret_cast<ta_global_parameter::end_of_list *>(store_queue) =
ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
sq_transfer_32byte(ta_fifo_polygon_converter);
}
}
void transfer_ta_fifo_texture_memory_32byte(void * dst, void * src, int length)
{
uint32_t out_addr = (uint32_t)dst;
sh7091.CCN.QACR0 = ((reinterpret_cast<uint32_t>(out_addr) >> 24) & 0b11100);
sh7091.CCN.QACR1 = ((reinterpret_cast<uint32_t>(out_addr) >> 24) & 0b11100);
volatile uint32_t * base = &store_queue[(out_addr & 0x03ffffc0) / 4];
uint32_t * src32 = reinterpret_cast<uint32_t *>(src);
length = (length + 31) & ~31; // round up to nearest multiple of 32
while (length > 0) {
base[0] = src32[0];
base[1] = src32[1];
base[2] = src32[2];
base[3] = src32[3];
base[4] = src32[4];
base[5] = src32[5];
base[6] = src32[6];
base[7] = src32[7];
asm volatile ("pref @%0"
: // output
: "r" (&base[0]) // input
: "memory");
length -= 32;
base += 8;
src32 += 8;
}
}
void transfer_textures()
{
system.LMMODE0 = 0; // 64-bit address space
system.LMMODE1 = 0; // 64-bit address space
for (uint32_t i = 0; i < (sizeof (elizabeth_material)) / (sizeof (elizabeth_material[0])); i++) {
const struct pixel_descriptor * pixel = &elizabeth_material[i].pixel;
uint32_t offset = texture_memory_alloc.texture.start + pixel->vram_offset;
void * dst = reinterpret_cast<void *>(&ta_fifo_texture_memory[offset / 4]);
void * src = reinterpret_cast<void *>(pixel->start);
transfer_ta_fifo_texture_memory_32byte(dst, src, pixel->width * pixel->height * 2);
}
}
void main()
{
serial::init(0);
transfer_textures();
constexpr uint32_t ta_alloc = ta_alloc_ctrl::pt_opb::_16x4byte
| ta_alloc_ctrl::tm_opb::no_list
| ta_alloc_ctrl::t_opb::no_list
| ta_alloc_ctrl::om_opb::no_list
| ta_alloc_ctrl::o_opb::_16x4byte;
constexpr int render_passes = 1;
constexpr struct opb_size opb_size[render_passes] = {
{
.opaque = 16 * 4,
.opaque_modifier = 0,
.translucent = 0,
.translucent_modifier = 0,
.punch_through = 16 * 4
}
};
holly.SOFTRESET = softreset::pipeline_soft_reset
| softreset::ta_soft_reset;
holly.SOFTRESET = 0;
core_init();
video_output::set_mode_vga();
const int framebuffer_width = 640;
const int framebuffer_height = 480;
const int tile_width = framebuffer_width / 32;
const int tile_height = framebuffer_height / 32;
region_array_multipass(tile_width,
tile_height,
opb_size,
render_passes,
texture_memory_alloc.region_array[0].start,
texture_memory_alloc.object_list[0].start);
background_parameter2(texture_memory_alloc.background[0].start,
0xff9090c0);
frame = 0;
while (1) {
ta_polygon_converter_init2(texture_memory_alloc.isp_tsp_parameters[0].start,
texture_memory_alloc.isp_tsp_parameters[0].end,
texture_memory_alloc.object_list[0].start,
texture_memory_alloc.object_list[0].end,
opb_size[0].total(),
ta_alloc,
tile_width,
tile_height);
transfer_scene();
ta_wait_punch_through_list();
core_start_render2(texture_memory_alloc.region_array[0].start,
texture_memory_alloc.isp_tsp_parameters[0].start,
texture_memory_alloc.background[0].start,
texture_memory_alloc.framebuffer[0].start,
framebuffer_width);
core_wait_end_of_render_video();
while (!spg_status::vsync(holly.SPG_STATUS));
holly.FB_R_SOF1 = texture_memory_alloc.framebuffer[0].start;
while (spg_status::vsync(holly.SPG_STATUS));
frame += 1;
theta += degree / 2;
}
serial::string("return\nreturn\nreturn\n");
}

View File

@ -831,3 +831,31 @@ TESTGROUND_OBJ = \
example/testground.elf: LDSCRIPT = $(LIB)/main.lds
example/testground.elf: $(START_OBJ) $(TESTGROUND_OBJ)
ELIZABETH_OBJ = \
example/elizabeth.o \
holly/core.o \
holly/region_array.o \
holly/background.o \
holly/ta_fifo_polygon_converter.o \
holly/video_output.o \
sh7091/serial.o \
model/elizabeth/elizabeth_sword_mat_emissive.data.o \
model/elizabeth/elizabeth_mat_emissive.data.o
example/elizabeth.elf: LDSCRIPT = $(LIB)/main.lds
example/elizabeth.elf: $(START_OBJ) $(ELIZABETH_OBJ)
SPECK_OBJ = \
example/speck.o \
holly/core.o \
holly/region_array.o \
holly/background.o \
holly/ta_fifo_polygon_converter.o \
holly/video_output.o \
sh7091/serial.o \
model/speck/speck.data.o \
model/speck/white.data.o
example/speck.elf: LDSCRIPT = $(LIB)/main.lds
example/speck.elf: $(START_OBJ) $(SPECK_OBJ)

476
example/speck.cpp Normal file
View File

@ -0,0 +1,476 @@
#include <stdint.h>
#include "holly/background.hpp"
#include "holly/core.hpp"
#include "holly/core_bits.hpp"
#include "holly/holly.hpp"
#include "holly/isp_tsp.hpp"
#include "holly/region_array.hpp"
#include "holly/ta_bits.hpp"
#include "holly/ta_fifo_polygon_converter.hpp"
#include "holly/ta_global_parameter.hpp"
#include "holly/ta_parameter.hpp"
#include "holly/ta_vertex_parameter.hpp"
#include "holly/texture_memory_alloc3.hpp"
#include "holly/video_output.hpp"
#include "sh7091/serial.hpp"
#include "sh7091/store_queue.hpp"
#include "systembus.hpp"
#include "systembus_bits.hpp"
#include "memory.hpp"
#include "model/model.h"
#include "model/material.h"
#include "model/speck/speck.data.h"
#include "model/speck/white.data.h"
#include "model/speck/material.h"
#include "model/speck/model.h"
using vec3 = vec<3, float>;
using vec2 = vec<2, float>;
const float degree = 0.017453292519943295;
static float theta = 0;
static int frame = 0;
static inline vec3 transform_vertex(const vec3 vec, const vec3 translate, const float scale)
{
float xm = -vec.x * scale;
float ym = -vec.y * scale;
float zm = vec.z * scale;
float x0 = xm * cos(theta) - zm * sin(theta);
float y0 = ym;
float z0 = xm * sin(theta) + zm * cos(theta);
/*
float x1 = x0 + translate.x;
float y1 = y0 + translate.y;
float z1 = z0 + translate.z;
*/
float x1 = x0;
float y1 = y0 * cos(theta) - z0 * sin(theta);
float z1 = y0 * sin(theta) + z0 * cos(theta);
float x2 = x1;
float y2 = y1;
float z2 = z1 + 1.5;
float x3 = x2 / z2;
float y3 = y2 / z2;
float z3 = 1.0 / z2;
float x = x3 * 240 + 320;
float y = y3 * 240 + 320 - 75;
float z = z3;
return {x, y, z};
}
static inline vec2 transform_uv(vec2 uv, float scale)
{
float x = uv.x * 1.3;// + ((float)frame * 0.003) * scale;
float y = uv.y * 1.3;// + ((float)frame * 0.003) * scale;
return {x, y};
}
static inline void transfer_triangle(ta_parameter_writer& writer,
const vertex_position * position,
const vertex_texture * texture,
const union triangle * triangle,
const uint32_t base_color,
const vec3 translate,
const float scale)
{
vec3 v1 = transform_vertex(position[triangle->a.position], translate, scale);
vec2 uv1 = transform_uv(texture[triangle->a.texture], scale);
writer.append<ta_vertex_parameter::polygon_type_3>() =
ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(false),
v1.x, v1.y, v1.z,
uv1.x, uv1.y,
base_color,
0); // offset_color
vec3 v2 = transform_vertex(position[triangle->b.position], translate, scale);
vec2 uv2 = transform_uv(texture[triangle->b.texture], scale);
writer.append<ta_vertex_parameter::polygon_type_3>() =
ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(false),
v2.x, v2.y, v2.z,
uv2.x, uv2.y,
base_color,
0); // offset_color
vec3 v3 = transform_vertex(position[triangle->c.position], translate, scale);
vec2 uv3 = transform_uv(texture[triangle->c.texture], scale);
writer.append<ta_vertex_parameter::polygon_type_3>() =
ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(true),
v3.x, v3.y, v3.z,
uv3.x, uv3.y,
base_color,
0); // offset_color
}
static inline void transfer_quadrilateral(ta_parameter_writer& writer,
const vertex_position * position,
const vertex_texture * texture,
const union quadrilateral * quadrilateral,
const uint32_t base_color,
const vec3 translate,
const float scale)
{
vec3 v1 = transform_vertex(position[quadrilateral->a.position], translate, scale);
vec2 uv1 = transform_uv(texture[quadrilateral->a.texture], scale);
writer.append<ta_vertex_parameter::polygon_type_3>() =
ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(false),
v1.x, v1.y, v1.z,
uv1.x, uv1.y,
base_color,
0); // offset_color
vec3 v2 = transform_vertex(position[quadrilateral->b.position], translate, scale);
vec2 uv2 = transform_uv(texture[quadrilateral->b.texture], scale);
writer.append<ta_vertex_parameter::polygon_type_3>() =
ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(false),
v2.x, v2.y, v2.z,
uv2.x, uv2.y,
base_color,
0); // offset_color
vec3 v4 = transform_vertex(position[quadrilateral->d.position], translate, scale);
vec2 uv4 = transform_uv(texture[quadrilateral->d.texture], scale);
writer.append<ta_vertex_parameter::polygon_type_3>() =
ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(false),
v4.x, v4.y, v4.z,
uv4.x, uv4.y,
base_color,
0); // offset_color
vec3 v3 = transform_vertex(position[quadrilateral->c.position], translate, scale);
vec2 uv3 = transform_uv(texture[quadrilateral->c.texture], scale);
writer.append<ta_vertex_parameter::polygon_type_3>() =
ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(true),
v3.x, v3.y, v3.z,
uv3.x, uv3.y,
base_color,
0); // offset_color
}
static inline void transfer_triangles(ta_parameter_writer& writer,
const struct model * model,
const struct material_descriptor * material,
const struct object * object,
const uint32_t list_type,
const uint32_t blending,
const uint32_t pixel_format,
const uint32_t base_color,
const vec3 translate,
const float scale)
{
if (object->triangle_count == 0 && object->quadrilateral_count == 0)
return;
const uint32_t parameter_control_word = para_control::para_type::polygon_or_modifier_volume
| list_type
| obj_control::col_type::packed_color
| obj_control::texture;
const uint32_t isp_tsp_instruction_word = isp_tsp_instruction_word::depth_compare_mode::greater
| isp_tsp_instruction_word::culling_mode::no_culling;
const uint32_t tsp_instruction_word = blending
| tsp_instruction_word::fog_control::no_fog;
const uint32_t texture_address = texture_memory_alloc.texture.start + material[object->material].pixel.vram_offset;
const uint32_t texture_control_word = pixel_format
| texture_control_word::scan_order::twiddled
| texture_control_word::texture_address(texture_address / 8);
writer.append<ta_global_parameter::polygon_type_0>() =
ta_global_parameter::polygon_type_0(parameter_control_word,
isp_tsp_instruction_word,
tsp_instruction_word,
texture_control_word,
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
for (int i = 0; i < object->triangle_count; i++) {
transfer_triangle(writer,
model->position, model->texture, &object->triangle[i],
base_color,
translate,
scale);
}
for (int i = 0; i < object->quadrilateral_count; i++) {
transfer_quadrilateral(writer,
model->position, model->texture, &object->quadrilateral[i],
base_color,
translate,
scale);
}
}
void transfer_scene(ta_parameter_writer& writer)
{
const struct model * model = &speck_model;
const struct material_descriptor * material = speck_material;
// opaque
if (1) {
const uint32_t list_type = para_control::list_type::opaque;
const uint32_t blending = tsp_instruction_word::src_alpha_instr::one
| tsp_instruction_word::dst_alpha_instr::zero
| tsp_instruction_word::texture_u_size::from_int(8)
| tsp_instruction_word::texture_v_size::from_int(8)
| tsp_instruction_word::texture_shading_instruction::modulate;
const uint32_t pixel_format = texture_control_word::pixel_format::_4444;
const uint32_t base_color = 0xffffffff;
const vec3 translate = {0, 0, 0};
const float scale = 0.83;
transfer_triangles(writer,
model, material,
&speck_Cube_white,
list_type,
blending,
pixel_format,
base_color,
translate,
scale);
writer.append<ta_global_parameter::end_of_list>() =
ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
}
const float scale[] {
1.000,
1.014,
1.031,
1.043,
1.066,
1.093,
};
static const uint32_t red[] {
4278190080,
3791650816,
3338665984,
2936012800,
2550136832,
2214592512,
1912602624,
1627389952,
1375731712,
1157627904,
956301312,
771751936,
620756992,
503316480,
385875968,
285212672,
218103808,
150994944,
100663296,
67108864,
33554432,
16777216,
16777216,
16777216,
};
// translucent
if (1) {
const uint32_t list_type = para_control::list_type::translucent;
const uint32_t blending = tsp_instruction_word::src_alpha_instr::src_alpha
| tsp_instruction_word::dst_alpha_instr::inverse_src_alpha
| tsp_instruction_word::texture_u_size::from_int(256)
| tsp_instruction_word::texture_v_size::from_int(256)
| tsp_instruction_word::texture_shading_instruction::modulate_alpha
| tsp_instruction_word::use_alpha
;
const uint32_t pixel_format = texture_control_word::pixel_format::_4444;
int shells = 23;
for (int i = 0; i < shells; i++) {
const uint32_t base_color = red[i] | 0xffffff;
const vec3 translate = {0, 0, 0};
const float _scale = 1.0 + (float)(i) * 0.107;
transfer_triangles(writer,
model, material,
&speck_Cube,
list_type,
blending,
pixel_format,
base_color,
translate,
_scale);
}
writer.append<ta_global_parameter::end_of_list>() =
ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
}
}
void transfer_ta_fifo_texture_memory_32byte(void * dst, void * src, int length)
{
uint32_t out_addr = (uint32_t)dst;
sh7091.CCN.QACR0 = ((reinterpret_cast<uint32_t>(out_addr) >> 24) & 0b11100);
sh7091.CCN.QACR1 = ((reinterpret_cast<uint32_t>(out_addr) >> 24) & 0b11100);
volatile uint32_t * base = &store_queue[(out_addr & 0x03ffffc0) / 4];
uint32_t * src32 = reinterpret_cast<uint32_t *>(src);
length = (length + 31) & ~31; // round up to nearest multiple of 32
while (length > 0) {
base[0] = src32[0];
base[1] = src32[1];
base[2] = src32[2];
base[3] = src32[3];
base[4] = src32[4];
base[5] = src32[5];
base[6] = src32[6];
base[7] = src32[7];
asm volatile ("pref @%0"
: // output
: "r" (&base[0]) // input
: "memory");
length -= 32;
base += 8;
src32 += 8;
}
}
void transfer_textures()
{
system.LMMODE0 = 0; // 64-bit address space
system.LMMODE1 = 0; // 64-bit address space
for (uint32_t i = 0; i < (sizeof (speck_material)) / (sizeof (speck_material[0])); i++) {
const struct pixel_descriptor * pixel = &speck_material[i].pixel;
uint32_t offset = texture_memory_alloc.texture.start + pixel->vram_offset;
void * dst = reinterpret_cast<void *>(&ta_fifo_texture_memory[offset / 4]);
void * src = reinterpret_cast<void *>(pixel->start);
transfer_ta_fifo_texture_memory_32byte(dst, src, pixel->width * pixel->height * 2);
}
}
uint8_t __attribute__((aligned(32))) ta_parameter_buf[1024 * 1024];
void main()
{
serial::init(0);
transfer_textures();
constexpr uint32_t ta_alloc = ta_alloc_ctrl::pt_opb::no_list
| ta_alloc_ctrl::tm_opb::no_list
| ta_alloc_ctrl::t_opb::_16x4byte
| ta_alloc_ctrl::om_opb::no_list
| ta_alloc_ctrl::o_opb::_16x4byte;
constexpr int render_passes = 1;
constexpr struct opb_size opb_size[render_passes] = {
{
.opaque = 16 * 4,
.opaque_modifier = 0,
.translucent = 16 * 4,
.translucent_modifier = 0,
.punch_through = 0
}
};
holly.SOFTRESET = softreset::pipeline_soft_reset
| softreset::ta_soft_reset;
holly.SOFTRESET = 0;
core_init();
video_output::set_mode_vga();
const int framebuffer_width = 640;
const int framebuffer_height = 480;
const int tile_width = framebuffer_width / 32;
const int tile_height = framebuffer_height / 32;
ta_parameter_writer writer = ta_parameter_writer(ta_parameter_buf);
for (int i = 0; i < 2; i++) {
region_array_multipass(tile_width,
tile_height,
opb_size,
render_passes,
texture_memory_alloc.region_array[i].start,
texture_memory_alloc.object_list[i].start);
background_parameter2(texture_memory_alloc.background[i].start,
0xff9090c0);
ta_polygon_converter_init2(texture_memory_alloc.isp_tsp_parameters[i].start,
texture_memory_alloc.isp_tsp_parameters[i].end,
texture_memory_alloc.object_list[i].start,
texture_memory_alloc.object_list[i].end,
opb_size[0].total(),
ta_alloc,
tile_width,
tile_height);
writer.offset = 0;
transfer_scene(writer);
ta_polygon_converter_writeback(writer.buf, writer.offset);
ta_polygon_converter_transfer(writer.buf, writer.offset);
if (i == 0)
ta_wait_translucent_list();
}
core_start_render2(texture_memory_alloc.region_array[0].start,
texture_memory_alloc.isp_tsp_parameters[0].start,
texture_memory_alloc.background[0].start,
texture_memory_alloc.framebuffer[0].start,
framebuffer_width);
frame = 1;
while (1) {
int ta = frame & 1;
int core = !ta;
// 1 -> {0, 0}
ta_wait_translucent_list();
ta_polygon_converter_init2(texture_memory_alloc.isp_tsp_parameters[ta].start,
texture_memory_alloc.isp_tsp_parameters[ta].end,
texture_memory_alloc.object_list[ta].start,
texture_memory_alloc.object_list[ta].end,
opb_size[0].total(),
ta_alloc,
tile_width,
tile_height);
writer.offset = 0;
transfer_scene(writer);
ta_polygon_converter_writeback(writer.buf, writer.offset);
core_wait_end_of_render_video();
ta_polygon_converter_transfer(writer.buf, writer.offset);
holly.FB_R_SOF1 = texture_memory_alloc.framebuffer[ta].start;
// 0 ->
core_start_render2(texture_memory_alloc.region_array[core].start,
texture_memory_alloc.isp_tsp_parameters[core].start,
texture_memory_alloc.background[core].start,
texture_memory_alloc.framebuffer[core].start,
framebuffer_width);
frame += 1;
theta += degree / 2;
}
serial::string("return\nreturn\nreturn\n");
}

View File

@ -269,28 +269,6 @@ void transfer_scene()
ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
sq_transfer_32byte(ta_fifo_polygon_converter);
}
// translucent
{
animate_uv = true;
const uint32_t list_type = para_control::list_type::translucent;
const uint32_t blending = tsp_instruction_word::src_alpha_instr::src_alpha
| tsp_instruction_word::dst_alpha_instr::inverse_src_alpha
| tsp_instruction_word::use_alpha
| tsp_instruction_word::texture_shading_instruction::decal_alpha;
const uint32_t pixel_format = texture_control_word::pixel_format::_565;
transfer_triangles(model, material,
&testscene_Waterfall,
list_type,
blending,
pixel_format);
*reinterpret_cast<ta_global_parameter::end_of_list *>(store_queue) =
ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
sq_transfer_32byte(ta_fifo_polygon_converter);
}
}
void transfer_ta_fifo_texture_memory_32byte(void * dst, void * src, int length)

View File

@ -151,17 +151,23 @@ void core_wait_end_of_render_video()
serial::integer<uint32_t>(istnrm);
serial::string("isterr ");
serial::integer<uint32_t>(system.ISTERR);
serial::string("pipeline_soft_reset\n");
holly.SOFTRESET = softreset::pipeline_soft_reset;
holly.SOFTRESET = 0;
system.ISTERR = system.ISTERR;
system.ISTNRM = istnrm::end_of_render_tsp
| istnrm::end_of_render_isp
| istnrm::end_of_render_video;
break;
}
//serial::integer<uint32_t>(system.ISTERR);
if (system.ISTERR) {
//serial::string("core ");
//serial::integer<uint32_t>(system.ISTERR);
holly.SOFTRESET = softreset::pipeline_soft_reset;
holly.SOFTRESET = 0;
//break;
}
if (count > 100000) {
if (count > 300000) {
serial::string("core timeout:\n");
serial::string("isterr ");
serial::integer<uint32_t>(system.ISTERR);

View File

@ -88,7 +88,19 @@ void ta_polygon_converter_cont(uint32_t ol_base_offset,
(void)_dummy_read;
}
void ta_polygon_converter_transfer(volatile uint32_t const * const buf, uint32_t size)
void ta_polygon_converter_writeback(void const * const buf, uint32_t size)
{
uint8_t const * const buf8 = reinterpret_cast<uint8_t const * const>(buf);
for (uint32_t i = 0; i < size / (32); i++) {
asm volatile ("ocbwb @%0"
: // output
: "r" (&buf8[i * 32]) // input
);
}
}
void ta_polygon_converter_transfer(void const * const buf, uint32_t size)
{
/* wait for previous transfer to complete (if any) */
//while ((system.C2DST & C2DST__STATUS) != 0); /* 1 == transfer is in progress */
@ -100,12 +112,6 @@ void ta_polygon_converter_transfer(volatile uint32_t const * const buf, uint32_t
This is required on real hardware if CCR__CB is enabled, and `buf` is in a
cacheable area (e.g: system memory access via 0x8c00_0000).*/
for (uint32_t i = 0; i < size / 32; i++) {
asm volatile ("ocbwb @%0"
: // output
: "r" (&buf[(i * 32) / 4]) // input
);
}
// this dummy read appears to be required on real hardware.
volatile uint32_t _dummy = sh7091.DMAC.CHCR2;
@ -115,7 +121,7 @@ void ta_polygon_converter_transfer(volatile uint32_t const * const buf, uint32_t
/* start a new CH2-DMA transfer from "system memory" to "TA FIFO polygon converter" */
sh7091.DMAC.CHCR2 = 0; /* disable DMA channel */
sh7091.DMAC.SAR2 = reinterpret_cast<uint32_t>(&buf[0]); /* start address, must be aligned to a CHCHR__TS-sized (32-byte) boundary */
sh7091.DMAC.SAR2 = reinterpret_cast<uint32_t>(buf); /* start address, must be aligned to a CHCHR__TS-sized (32-byte) boundary */
sh7091.DMAC.DMATCR2 = dmatcr::transfer_count(size / 32); /* transfer count, in CHCHR__TS-sized (32-byte) units */
sh7091.DMAC.CHCR2 = chcr::dm::destination_address_fixed
| chcr::sm::source_address_incremented

View File

@ -17,7 +17,8 @@ void ta_polygon_converter_init2(uint32_t isp_tsp_parameters_start,
uint32_t tile_height); // in tile units (e.g: (480 / 32))
void ta_polygon_converter_cont(uint32_t ol_base_offset,
uint32_t ta_alloc);
void ta_polygon_converter_transfer(volatile uint32_t const * const buf, uint32_t size);
void ta_polygon_converter_writeback(void const * const buf, uint32_t size);
void ta_polygon_converter_transfer(void const * const buf, uint32_t size);
void ta_wait_opaque_list();
void ta_wait_opaque_modifier_volume_list();
void ta_wait_translucent_list();

View File

@ -82,17 +82,18 @@ constexpr uint32_t modifier_volume_vertex_parameter_control_word()
}
struct ta_parameter_writer {
uint32_t * buf;
uint8_t * buf;
uint32_t offset; // in bytes
ta_parameter_writer(uint32_t * buf)
: buf(buf), offset(0)
template <typename T>
ta_parameter_writer(T * buf)
: buf(reinterpret_cast<uint8_t *>(buf)), offset(0)
{ }
template <typename T>
inline T& append()
{
T& t = *reinterpret_cast<T *>(&buf[offset / 4]);
T& t = *reinterpret_cast<T *>(&buf[offset]);
offset += (sizeof (T));
return t;
}

Binary file not shown.

View File

@ -0,0 +1,22 @@
# Blender 4.2.1 LTS MTL File: 'elizabeth.blend'
# www.blender.org
newmtl elizabeth_mat
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.000000 0.000000 0.000000
Ks 0.500000 0.500000 0.500000
Ni 1.500000
d 1.000000
illum 2
map_Kd elizabeth_mat_emissive.png
newmtl elizabeth_sword_mat
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.000000 0.000000 0.000000
Ks 0.500000 0.500000 0.500000
Ni 1.500000
d 1.000000
illum 2
map_Kd elizabeth_sword_mat_emissive.png

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,15 @@
#pragma once
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
extern uint32_t _binary_model_elizabeth_elizabeth_mat_emissive_data_start __asm("_binary_model_elizabeth_elizabeth_mat_emissive_data_start");
extern uint32_t _binary_model_elizabeth_elizabeth_mat_emissive_data_end __asm("_binary_model_elizabeth_elizabeth_mat_emissive_data_end");
extern uint32_t _binary_model_elizabeth_elizabeth_mat_emissive_data_size __asm("_binary_model_elizabeth_elizabeth_mat_emissive_data_size");
#ifdef __cplusplus
}
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

View File

@ -0,0 +1,15 @@
#pragma once
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
extern uint32_t _binary_model_elizabeth_elizabeth_sword_mat_emissive_data_start __asm("_binary_model_elizabeth_elizabeth_sword_mat_emissive_data_start");
extern uint32_t _binary_model_elizabeth_elizabeth_sword_mat_emissive_data_end __asm("_binary_model_elizabeth_elizabeth_sword_mat_emissive_data_end");
extern uint32_t _binary_model_elizabeth_elizabeth_sword_mat_emissive_data_size __asm("_binary_model_elizabeth_elizabeth_sword_mat_emissive_data_size");
#ifdef __cplusplus
}
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@ -0,0 +1,11 @@
Model Information:
* title: elizabeth
* source: https://sketchfab.com/3d-models/elizabeth-1116f2dac62b490b989ff0634aae0bf9
* author: pyr0xene (https://sketchfab.com/pyr0xene)
Model License:
* license type: CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)
* requirements: Author must be credited. Commercial use is allowed.
If you use this 3D model in your project be sure to copy paste this credit wherever you share it:
This work is based on "elizabeth" (https://sketchfab.com/3d-models/elizabeth-1116f2dac62b490b989ff0634aae0bf9) by pyr0xene (https://sketchfab.com/pyr0xene) licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)

View File

@ -0,0 +1,32 @@
#pragma once
#include <stdint.h>
#include "model/material.h"
enum material {
elizabeth_elizabeth_mat,
elizabeth_elizabeth_sword_mat,
};
const struct material_descriptor elizabeth_material[] = {
[elizabeth_elizabeth_mat] = {
.pixel = {
.start = (uint8_t *)&_binary_model_elizabeth_elizabeth_mat_emissive_data_start,
.size = (int)&_binary_model_elizabeth_elizabeth_mat_emissive_data_size,
.vram_offset = 0,
.width = 128,
.height = 128,
},
},
[elizabeth_elizabeth_sword_mat] = {
.pixel = {
.start = (uint8_t *)&_binary_model_elizabeth_elizabeth_sword_mat_emissive_data_start,
.size = (int)&_binary_model_elizabeth_elizabeth_sword_mat_emissive_data_size,
.vram_offset = 32768,
.width = 32,
.height = 64,
},
},
};

5251
model/elizabeth/model.h Normal file

File diff suppressed because it is too large Load Diff

1250
model/elizabeth/scene.gltf Normal file

File diff suppressed because it is too large Load Diff

31
model/speck/material.h Normal file
View File

@ -0,0 +1,31 @@
#pragma once
#include <stdint.h>
#include "model/material.h"
enum material {
speck_matSpeck,
speck_white
};
const struct material_descriptor speck_material[] = {
[speck_matSpeck] = {
.pixel = {
.start = (uint8_t *)&_binary_model_speck_speck_data_start,
.size = (int)&_binary_model_speck_speck_data_size,
.vram_offset = 0,
.width = 256,
.height = 256,
},
},
[speck_white] = {
.pixel = {
.start = (uint8_t *)&_binary_model_speck_white_data_start,
.size = (int)&_binary_model_speck_white_data_size,
.vram_offset = 0,
.width = 8,
.height = 8,
},
},
};

845
model/speck/model.h Normal file
View File

@ -0,0 +1,845 @@
#pragma once
#include <stddef.h>
#include "../model.h"
// floating-point
const vertex_position speck_position[] = {
{-0.5, -0.5, 0.5},
{-0.5, 0.5, 0.5},
{-0.5, -0.5, -0.5},
{-0.5, 0.5, -0.5},
{0.5, -0.5, 0.5},
{0.5, 0.5, 0.5},
{0.5, -0.5, -0.5},
{0.5, 0.5, -0.5},
{-0.572933, -0.572933, -0.29665},
{-0.609568, -0.609568, 0.0},
{-0.572933, -0.572933, 0.29665},
{-0.572933, -0.29665, 0.572933},
{-0.609568, 0.0, 0.609568},
{-0.572933, 0.29665, 0.572933},
{-0.572933, 0.572933, 0.29665},
{-0.609568, 0.609568, 0.0},
{-0.572933, 0.572933, -0.29665},
{-0.572933, 0.29665, -0.572933},
{-0.609568, 0.0, -0.609568},
{-0.572933, -0.29665, -0.572933},
{0.29665, -0.572933, -0.572933},
{0.0, -0.609568, -0.609568},
{-0.29665, -0.572933, -0.572933},
{-0.29665, 0.572933, -0.572933},
{0.0, 0.609568, -0.609568},
{0.29665, 0.572933, -0.572933},
{0.572933, 0.29665, -0.572933},
{0.609568, 0.0, -0.609568},
{0.572933, -0.29665, -0.572933},
{0.572933, -0.572933, 0.29665},
{0.609568, -0.609568, 0.0},
{0.572933, -0.572933, -0.29665},
{0.572933, 0.572933, -0.29665},
{0.609568, 0.609568, 0.0},
{0.572933, 0.572933, 0.29665},
{0.572933, 0.29665, 0.572933},
{0.609568, 0.0, 0.609568},
{0.572933, -0.29665, 0.572933},
{-0.29665, -0.572933, 0.572933},
{0.0, -0.609568, 0.609568},
{0.29665, -0.572933, 0.572933},
{0.29665, 0.572933, 0.572933},
{0.0, 0.609568, 0.609568},
{-0.29665, 0.572933, 0.572933},
{-0.72899, -0.316157, 0.316157},
{-0.781829, 0.0, 0.33314},
{-0.72899, 0.316157, 0.316157},
{-0.781829, -0.33314, 0.0},
{-0.839506, 0.0, 0.0},
{-0.781829, 0.33314, 0.0},
{-0.72899, -0.316157, -0.316157},
{-0.781829, 0.0, -0.33314},
{-0.72899, 0.316157, -0.316157},
{-0.316157, -0.316157, -0.72899},
{-0.33314, 0.0, -0.781829},
{-0.316157, 0.316157, -0.72899},
{0.0, -0.33314, -0.781829},
{0.0, 0.0, -0.839506},
{0.0, 0.33314, -0.781829},
{0.316157, -0.316157, -0.72899},
{0.33314, 0.0, -0.781829},
{0.316157, 0.316157, -0.72899},
{0.72899, -0.316157, -0.316157},
{0.781829, 0.0, -0.33314},
{0.72899, 0.316157, -0.316157},
{0.781829, -0.33314, 0.0},
{0.839506, 0.0, 0.0},
{0.781829, 0.33314, 0.0},
{0.72899, -0.316157, 0.316157},
{0.781829, 0.0, 0.33314},
{0.72899, 0.316157, 0.316157},
{0.316157, -0.316157, 0.72899},
{0.33314, 0.0, 0.781829},
{0.316157, 0.316157, 0.72899},
{0.0, -0.33314, 0.781829},
{0.0, 0.0, 0.839506},
{0.0, 0.33314, 0.781829},
{-0.316157, -0.316157, 0.72899},
{-0.33314, 0.0, 0.781829},
{-0.316157, 0.316157, 0.72899},
{-0.316157, -0.72899, -0.316157},
{0.0, -0.781829, -0.33314},
{0.316157, -0.72899, -0.316157},
{-0.33314, -0.781829, 0.0},
{0.0, -0.839506, 0.0},
{0.33314, -0.781829, 0.0},
{-0.316157, -0.72899, 0.316157},
{0.0, -0.781829, 0.33314},
{0.316157, -0.72899, 0.316157},
{0.316157, 0.72899, -0.316157},
{0.0, 0.781829, -0.33314},
{-0.316157, 0.72899, -0.316157},
{0.33314, 0.781829, 0.0},
{0.0, 0.839506, 0.0},
{-0.33314, 0.781829, 0.0},
{0.316157, 0.72899, 0.316157},
{0.0, 0.781829, 0.33314},
{-0.316157, 0.72899, 0.316157},
};
// floating-point
const vertex_texture speck_texture[] = {
{0.25, 0.25},
{0.5, 0.25},
{0.5, 0.5},
{0.25, 0.5},
{0.75, 0.25},
{0.75, 0.5},
{0.5, 0.75},
{0.25, 0.75},
{0.75, 0.75},
{0.0, 0.0},
{0.25, 0.0},
{0.0, 0.25},
{0.5, 0.0},
{0.75, 0.0},
{1.0, 0.0},
{1.0, 0.25},
{1.0, 0.5},
{1.0, 0.75},
{1.0, 1.0},
{0.75, 1.0},
{0.5, 1.0},
{0.25, 1.0},
{0.0, 0.75},
{0.0, 1.0},
{0.0, 0.5},
};
// floating-point
const vertex_normal speck_normal[] = {
{-0.57735, -0.57735, 0.57735},
{-0.57735, 0.57735, 0.57735},
{-0.57735, -0.57735, -0.57735},
{-0.57735, 0.57735, -0.57735},
{0.57735, -0.57735, 0.57735},
{0.57735, 0.57735, 0.57735},
{0.57735, -0.57735, -0.57735},
{0.57735, 0.57735, -0.57735},
{-0.67094, -0.67094, -0.315719},
{-0.707107, -0.707107, 0.0},
{-0.67094, -0.67094, 0.315719},
{-0.67094, -0.315719, 0.67094},
{-0.707107, 0.0, 0.707107},
{-0.67094, 0.315719, 0.67094},
{-0.67094, 0.67094, 0.315719},
{-0.707107, 0.707107, 0.0},
{-0.67094, 0.67094, -0.315719},
{-0.67094, 0.315719, -0.67094},
{-0.707107, 0.0, -0.707107},
{-0.67094, -0.315719, -0.67094},
{0.315719, -0.67094, -0.67094},
{0.0, -0.707107, -0.707107},
{-0.315719, -0.67094, -0.67094},
{-0.315719, 0.67094, -0.67094},
{0.0, 0.707107, -0.707107},
{0.315719, 0.67094, -0.67094},
{0.67094, 0.315719, -0.67094},
{0.707107, 0.0, -0.707107},
{0.67094, -0.315719, -0.67094},
{0.67094, -0.67094, 0.315719},
{0.707107, -0.707107, 0.0},
{0.67094, -0.67094, -0.315719},
{0.67094, 0.67094, -0.315719},
{0.707107, 0.707107, 0.0},
{0.67094, 0.67094, 0.315719},
{0.67094, 0.315719, 0.67094},
{0.707107, 0.0, 0.707107},
{0.67094, -0.315719, 0.67094},
{-0.315719, -0.67094, 0.67094},
{0.0, -0.707107, 0.707107},
{0.315719, -0.67094, 0.67094},
{0.315719, 0.67094, 0.67094},
{0.0, 0.707107, 0.707107},
{-0.315719, 0.67094, 0.67094},
{-0.879729, -0.336211, 0.336211},
{-0.934488, 0.0, 0.355995},
{-0.879729, 0.336211, 0.336211},
{-0.934488, -0.355995, 0.0},
{-1.0, 0.0, 0.0},
{-0.934488, 0.355995, 0.0},
{-0.879729, -0.336211, -0.336211},
{-0.934488, 0.0, -0.355995},
{-0.879729, 0.336211, -0.336211},
{-0.336211, -0.336211, -0.879729},
{-0.355995, 0.0, -0.934488},
{-0.336211, 0.336211, -0.879729},
{0.0, -0.355995, -0.934488},
{0.0, 0.0, -1.0},
{0.0, 0.355995, -0.934488},
{0.336211, -0.336211, -0.879729},
{0.355995, 0.0, -0.934488},
{0.336211, 0.336211, -0.879729},
{0.879729, -0.336211, -0.336211},
{0.934488, 0.0, -0.355995},
{0.879729, 0.336211, -0.336211},
{0.934488, -0.355995, 0.0},
{1.0, 0.0, 0.0},
{0.934488, 0.355995, 0.0},
{0.879729, -0.336211, 0.336211},
{0.934488, 0.0, 0.355995},
{0.879729, 0.336211, 0.336211},
{0.336211, -0.336211, 0.879729},
{0.355995, 0.0, 0.934488},
{0.336211, 0.336211, 0.879729},
{0.0, -0.355995, 0.934488},
{0.0, 0.0, 1.0},
{0.0, 0.355995, 0.934488},
{-0.336211, -0.336211, 0.879729},
{-0.355995, 0.0, 0.934488},
{-0.336211, 0.336211, 0.879729},
{-0.336211, -0.879729, -0.336211},
{0.0, -0.934488, -0.355995},
{0.336211, -0.879729, -0.336211},
{-0.355995, -0.934488, 0.0},
{0.0, -1.0, 0.0},
{0.355995, -0.934488, 0.0},
{-0.336211, -0.879729, 0.336211},
{0.0, -0.934488, 0.355995},
{0.336211, -0.879729, 0.336211},
{0.336211, 0.879729, -0.336211},
{0.0, 0.934488, -0.355995},
{-0.336211, 0.879729, -0.336211},
{0.355995, 0.934488, 0.0},
{0.0, 1.0, 0.0},
{-0.355995, 0.934488, 0.0},
{0.336211, 0.879729, 0.336211},
{0.0, 0.934488, 0.355995},
{-0.336211, 0.879729, 0.336211},
};
union quadrilateral speck_Cube_quadrilateral[] = {
{ .v = {
{44, 0, 44},
{45, 1, 45},
{48, 2, 48},
{47, 3, 47},
}},
{ .v = {
{45, 1, 45},
{46, 4, 46},
{49, 5, 49},
{48, 2, 48},
}},
{ .v = {
{47, 3, 47},
{48, 2, 48},
{51, 6, 51},
{50, 7, 50},
}},
{ .v = {
{48, 2, 48},
{49, 5, 49},
{52, 8, 52},
{51, 6, 51},
}},
{ .v = {
{0, 9, 0},
{11, 10, 11},
{44, 0, 44},
{10, 11, 10},
}},
{ .v = {
{11, 10, 11},
{12, 12, 12},
{45, 1, 45},
{44, 0, 44},
}},
{ .v = {
{12, 12, 12},
{13, 13, 13},
{46, 4, 46},
{45, 1, 45},
}},
{ .v = {
{13, 13, 13},
{1, 14, 1},
{14, 15, 14},
{46, 4, 46},
}},
{ .v = {
{46, 4, 46},
{14, 15, 14},
{15, 16, 15},
{49, 5, 49},
}},
{ .v = {
{49, 5, 49},
{15, 16, 15},
{16, 17, 16},
{52, 8, 52},
}},
{ .v = {
{52, 8, 52},
{16, 17, 16},
{3, 18, 3},
{17, 19, 17},
}},
{ .v = {
{51, 6, 51},
{52, 8, 52},
{17, 19, 17},
{18, 20, 18},
}},
{ .v = {
{50, 7, 50},
{51, 6, 51},
{18, 20, 18},
{19, 21, 19},
}},
{ .v = {
{8, 22, 8},
{50, 7, 50},
{19, 21, 19},
{2, 23, 2},
}},
{ .v = {
{9, 24, 9},
{47, 3, 47},
{50, 7, 50},
{8, 22, 8},
}},
{ .v = {
{10, 11, 10},
{44, 0, 44},
{47, 3, 47},
{9, 24, 9},
}},
{ .v = {
{53, 0, 53},
{54, 1, 54},
{57, 2, 57},
{56, 3, 56},
}},
{ .v = {
{54, 1, 54},
{55, 4, 55},
{58, 5, 58},
{57, 2, 57},
}},
{ .v = {
{56, 3, 56},
{57, 2, 57},
{60, 6, 60},
{59, 7, 59},
}},
{ .v = {
{57, 2, 57},
{58, 5, 58},
{61, 8, 61},
{60, 6, 60},
}},
{ .v = {
{2, 9, 2},
{19, 10, 19},
{53, 0, 53},
{22, 11, 22},
}},
{ .v = {
{19, 10, 19},
{18, 12, 18},
{54, 1, 54},
{53, 0, 53},
}},
{ .v = {
{18, 12, 18},
{17, 13, 17},
{55, 4, 55},
{54, 1, 54},
}},
{ .v = {
{17, 13, 17},
{3, 14, 3},
{23, 15, 23},
{55, 4, 55},
}},
{ .v = {
{55, 4, 55},
{23, 15, 23},
{24, 16, 24},
{58, 5, 58},
}},
{ .v = {
{58, 5, 58},
{24, 16, 24},
{25, 17, 25},
{61, 8, 61},
}},
{ .v = {
{61, 8, 61},
{25, 17, 25},
{7, 18, 7},
{26, 19, 26},
}},
{ .v = {
{60, 6, 60},
{61, 8, 61},
{26, 19, 26},
{27, 20, 27},
}},
{ .v = {
{59, 7, 59},
{60, 6, 60},
{27, 20, 27},
{28, 21, 28},
}},
{ .v = {
{20, 22, 20},
{59, 7, 59},
{28, 21, 28},
{6, 23, 6},
}},
{ .v = {
{21, 24, 21},
{56, 3, 56},
{59, 7, 59},
{20, 22, 20},
}},
{ .v = {
{22, 11, 22},
{53, 0, 53},
{56, 3, 56},
{21, 24, 21},
}},
{ .v = {
{62, 0, 62},
{63, 1, 63},
{66, 2, 66},
{65, 3, 65},
}},
{ .v = {
{63, 1, 63},
{64, 4, 64},
{67, 5, 67},
{66, 2, 66},
}},
{ .v = {
{65, 3, 65},
{66, 2, 66},
{69, 6, 69},
{68, 7, 68},
}},
{ .v = {
{66, 2, 66},
{67, 5, 67},
{70, 8, 70},
{69, 6, 69},
}},
{ .v = {
{6, 9, 6},
{28, 10, 28},
{62, 0, 62},
{31, 11, 31},
}},
{ .v = {
{28, 10, 28},
{27, 12, 27},
{63, 1, 63},
{62, 0, 62},
}},
{ .v = {
{27, 12, 27},
{26, 13, 26},
{64, 4, 64},
{63, 1, 63},
}},
{ .v = {
{26, 13, 26},
{7, 14, 7},
{32, 15, 32},
{64, 4, 64},
}},
{ .v = {
{64, 4, 64},
{32, 15, 32},
{33, 16, 33},
{67, 5, 67},
}},
{ .v = {
{67, 5, 67},
{33, 16, 33},
{34, 17, 34},
{70, 8, 70},
}},
{ .v = {
{70, 8, 70},
{34, 17, 34},
{5, 18, 5},
{35, 19, 35},
}},
{ .v = {
{69, 6, 69},
{70, 8, 70},
{35, 19, 35},
{36, 20, 36},
}},
{ .v = {
{68, 7, 68},
{69, 6, 69},
{36, 20, 36},
{37, 21, 37},
}},
{ .v = {
{29, 22, 29},
{68, 7, 68},
{37, 21, 37},
{4, 23, 4},
}},
{ .v = {
{30, 24, 30},
{65, 3, 65},
{68, 7, 68},
{29, 22, 29},
}},
{ .v = {
{31, 11, 31},
{62, 0, 62},
{65, 3, 65},
{30, 24, 30},
}},
{ .v = {
{71, 0, 71},
{72, 1, 72},
{75, 2, 75},
{74, 3, 74},
}},
{ .v = {
{72, 1, 72},
{73, 4, 73},
{76, 5, 76},
{75, 2, 75},
}},
{ .v = {
{74, 3, 74},
{75, 2, 75},
{78, 6, 78},
{77, 7, 77},
}},
{ .v = {
{75, 2, 75},
{76, 5, 76},
{79, 8, 79},
{78, 6, 78},
}},
{ .v = {
{4, 9, 4},
{37, 10, 37},
{71, 0, 71},
{40, 11, 40},
}},
{ .v = {
{37, 10, 37},
{36, 12, 36},
{72, 1, 72},
{71, 0, 71},
}},
{ .v = {
{36, 12, 36},
{35, 13, 35},
{73, 4, 73},
{72, 1, 72},
}},
{ .v = {
{35, 13, 35},
{5, 14, 5},
{41, 15, 41},
{73, 4, 73},
}},
{ .v = {
{73, 4, 73},
{41, 15, 41},
{42, 16, 42},
{76, 5, 76},
}},
{ .v = {
{76, 5, 76},
{42, 16, 42},
{43, 17, 43},
{79, 8, 79},
}},
{ .v = {
{79, 8, 79},
{43, 17, 43},
{1, 18, 1},
{13, 19, 13},
}},
{ .v = {
{78, 6, 78},
{79, 8, 79},
{13, 19, 13},
{12, 20, 12},
}},
{ .v = {
{77, 7, 77},
{78, 6, 78},
{12, 20, 12},
{11, 21, 11},
}},
{ .v = {
{38, 22, 38},
{77, 7, 77},
{11, 21, 11},
{0, 23, 0},
}},
{ .v = {
{39, 24, 39},
{74, 3, 74},
{77, 7, 77},
{38, 22, 38},
}},
{ .v = {
{40, 11, 40},
{71, 0, 71},
{74, 3, 74},
{39, 24, 39},
}},
{ .v = {
{80, 0, 80},
{81, 1, 81},
{84, 2, 84},
{83, 3, 83},
}},
{ .v = {
{81, 1, 81},
{82, 4, 82},
{85, 5, 85},
{84, 2, 84},
}},
{ .v = {
{83, 3, 83},
{84, 2, 84},
{87, 6, 87},
{86, 7, 86},
}},
{ .v = {
{84, 2, 84},
{85, 5, 85},
{88, 8, 88},
{87, 6, 87},
}},
{ .v = {
{2, 9, 2},
{22, 10, 22},
{80, 0, 80},
{8, 11, 8},
}},
{ .v = {
{22, 10, 22},
{21, 12, 21},
{81, 1, 81},
{80, 0, 80},
}},
{ .v = {
{21, 12, 21},
{20, 13, 20},
{82, 4, 82},
{81, 1, 81},
}},
{ .v = {
{20, 13, 20},
{6, 14, 6},
{31, 15, 31},
{82, 4, 82},
}},
{ .v = {
{82, 4, 82},
{31, 15, 31},
{30, 16, 30},
{85, 5, 85},
}},
{ .v = {
{85, 5, 85},
{30, 16, 30},
{29, 17, 29},
{88, 8, 88},
}},
{ .v = {
{88, 8, 88},
{29, 17, 29},
{4, 18, 4},
{40, 19, 40},
}},
{ .v = {
{87, 6, 87},
{88, 8, 88},
{40, 19, 40},
{39, 20, 39},
}},
{ .v = {
{86, 7, 86},
{87, 6, 87},
{39, 20, 39},
{38, 21, 38},
}},
{ .v = {
{10, 22, 10},
{86, 7, 86},
{38, 21, 38},
{0, 23, 0},
}},
{ .v = {
{9, 24, 9},
{83, 3, 83},
{86, 7, 86},
{10, 22, 10},
}},
{ .v = {
{8, 11, 8},
{80, 0, 80},
{83, 3, 83},
{9, 24, 9},
}},
{ .v = {
{89, 0, 89},
{90, 1, 90},
{93, 2, 93},
{92, 3, 92},
}},
{ .v = {
{90, 1, 90},
{91, 4, 91},
{94, 5, 94},
{93, 2, 93},
}},
{ .v = {
{92, 3, 92},
{93, 2, 93},
{96, 6, 96},
{95, 7, 95},
}},
{ .v = {
{93, 2, 93},
{94, 5, 94},
{97, 8, 97},
{96, 6, 96},
}},
{ .v = {
{7, 9, 7},
{25, 10, 25},
{89, 0, 89},
{32, 11, 32},
}},
{ .v = {
{25, 10, 25},
{24, 12, 24},
{90, 1, 90},
{89, 0, 89},
}},
{ .v = {
{24, 12, 24},
{23, 13, 23},
{91, 4, 91},
{90, 1, 90},
}},
{ .v = {
{23, 13, 23},
{3, 14, 3},
{16, 15, 16},
{91, 4, 91},
}},
{ .v = {
{91, 4, 91},
{16, 15, 16},
{15, 16, 15},
{94, 5, 94},
}},
{ .v = {
{94, 5, 94},
{15, 16, 15},
{14, 17, 14},
{97, 8, 97},
}},
{ .v = {
{97, 8, 97},
{14, 17, 14},
{1, 18, 1},
{43, 19, 43},
}},
{ .v = {
{96, 6, 96},
{97, 8, 97},
{43, 19, 43},
{42, 20, 42},
}},
{ .v = {
{95, 7, 95},
{96, 6, 96},
{42, 20, 42},
{41, 21, 41},
}},
{ .v = {
{34, 22, 34},
{95, 7, 95},
{41, 21, 41},
{5, 23, 5},
}},
{ .v = {
{33, 24, 33},
{92, 3, 92},
{95, 7, 95},
{34, 22, 34},
}},
{ .v = {
{32, 11, 32},
{89, 0, 89},
{92, 3, 92},
{33, 24, 33},
}},
};
const struct object speck_Cube = {
.triangle = NULL,
.quadrilateral = &speck_Cube_quadrilateral[0],
.triangle_count = 0,
.quadrilateral_count = 96,
.material = speck_matSpeck,
};
const struct object speck_Cube_white = {
.triangle = NULL,
.quadrilateral = &speck_Cube_quadrilateral[0],
.triangle_count = 0,
.quadrilateral_count = 96,
.material = speck_white,
};
const struct object * speck_object_list[] = {
&speck_Cube,
};
const struct model speck_model = {
.position = &speck_position[0],
.texture = &speck_texture[0],
.normal = &speck_normal[0],
.object = &speck_object_list[0],
.object_count = 1,
};

BIN
model/speck/speck.blend Normal file

Binary file not shown.

BIN
model/speck/speck.data Normal file

Binary file not shown.

15
model/speck/speck.data.h Normal file
View File

@ -0,0 +1,15 @@
#pragma once
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
extern uint32_t _binary_model_speck_speck_data_start __asm("_binary_model_speck_speck_data_start");
extern uint32_t _binary_model_speck_speck_data_end __asm("_binary_model_speck_speck_data_end");
extern uint32_t _binary_model_speck_speck_data_size __asm("_binary_model_speck_speck_data_size");
#ifdef __cplusplus
}
#endif

12
model/speck/speck.mtl Normal file
View File

@ -0,0 +1,12 @@
# Blender 4.2.1 LTS MTL File: 'speck.blend'
# www.blender.org
newmtl matSpeck
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.500000
d 1.000000
illum 2
map_Kd speck.png

323
model/speck/speck.obj Normal file
View File

@ -0,0 +1,323 @@
# Blender 4.2.1 LTS
# www.blender.org
mtllib speck.mtl
o Cube
v -0.500000 -0.500000 0.500000
v -0.500000 0.500000 0.500000
v -0.500000 -0.500000 -0.500000
v -0.500000 0.500000 -0.500000
v 0.500000 -0.500000 0.500000
v 0.500000 0.500000 0.500000
v 0.500000 -0.500000 -0.500000
v 0.500000 0.500000 -0.500000
v -0.572933 -0.572933 -0.296650
v -0.609568 -0.609568 0.000000
v -0.572933 -0.572933 0.296650
v -0.572933 -0.296650 0.572933
v -0.609568 -0.000000 0.609568
v -0.572933 0.296650 0.572933
v -0.572933 0.572933 0.296650
v -0.609568 0.609568 0.000000
v -0.572933 0.572933 -0.296650
v -0.572933 0.296650 -0.572933
v -0.609568 -0.000000 -0.609568
v -0.572933 -0.296650 -0.572933
v 0.296650 -0.572933 -0.572933
v 0.000000 -0.609568 -0.609568
v -0.296650 -0.572933 -0.572933
v -0.296650 0.572933 -0.572933
v -0.000000 0.609568 -0.609568
v 0.296650 0.572933 -0.572933
v 0.572933 0.296650 -0.572933
v 0.609568 -0.000000 -0.609568
v 0.572933 -0.296650 -0.572933
v 0.572933 -0.572933 0.296650
v 0.609568 -0.609568 0.000000
v 0.572933 -0.572933 -0.296650
v 0.572933 0.572933 -0.296650
v 0.609568 0.609568 -0.000000
v 0.572933 0.572933 0.296650
v 0.572933 0.296650 0.572933
v 0.609568 -0.000000 0.609568
v 0.572933 -0.296650 0.572933
v -0.296650 -0.572933 0.572933
v -0.000000 -0.609568 0.609568
v 0.296650 -0.572933 0.572933
v 0.296650 0.572933 0.572933
v 0.000000 0.609568 0.609568
v -0.296650 0.572933 0.572933
v -0.728990 -0.316157 0.316157
v -0.781829 -0.000000 0.333140
v -0.728990 0.316157 0.316157
v -0.781829 -0.333140 -0.000000
v -0.839506 0.000000 0.000000
v -0.781829 0.333140 0.000000
v -0.728990 -0.316157 -0.316157
v -0.781829 0.000000 -0.333140
v -0.728990 0.316157 -0.316157
v -0.316157 -0.316157 -0.728990
v -0.333140 -0.000000 -0.781829
v -0.316157 0.316157 -0.728990
v 0.000000 -0.333140 -0.781829
v 0.000000 0.000000 -0.839506
v -0.000000 0.333140 -0.781829
v 0.316157 -0.316157 -0.728990
v 0.333140 0.000000 -0.781829
v 0.316157 0.316157 -0.728990
v 0.728990 -0.316157 -0.316157
v 0.781829 -0.000000 -0.333140
v 0.728990 0.316157 -0.316157
v 0.781829 -0.333140 0.000000
v 0.839506 0.000000 0.000000
v 0.781829 0.333140 -0.000000
v 0.728990 -0.316157 0.316157
v 0.781829 0.000000 0.333140
v 0.728990 0.316157 0.316157
v 0.316157 -0.316157 0.728990
v 0.333140 -0.000000 0.781829
v 0.316157 0.316157 0.728990
v -0.000000 -0.333140 0.781829
v -0.000000 0.000000 0.839506
v 0.000000 0.333140 0.781829
v -0.316157 -0.316157 0.728990
v -0.333140 0.000000 0.781829
v -0.316157 0.316157 0.728990
v -0.316157 -0.728990 -0.316157
v -0.000000 -0.781829 -0.333140
v 0.316157 -0.728990 -0.316157
v -0.333140 -0.781829 0.000000
v -0.000000 -0.839506 0.000000
v 0.333140 -0.781829 -0.000000
v -0.316157 -0.728990 0.316157
v 0.000000 -0.781829 0.333140
v 0.316157 -0.728990 0.316157
v 0.316157 0.728990 -0.316157
v 0.000000 0.781829 -0.333140
v -0.316157 0.728990 -0.316157
v 0.333140 0.781829 0.000000
v -0.000000 0.839506 0.000000
v -0.333140 0.781829 0.000000
v 0.316157 0.728990 0.316157
v -0.000000 0.781829 0.333140
v -0.316157 0.728990 0.316157
vn -0.5774 -0.5774 0.5774
vn -0.5774 0.5774 0.5774
vn -0.5774 -0.5774 -0.5774
vn -0.5774 0.5774 -0.5774
vn 0.5774 -0.5774 0.5774
vn 0.5774 0.5774 0.5774
vn 0.5774 -0.5774 -0.5774
vn 0.5774 0.5774 -0.5774
vn -0.6709 -0.6709 -0.3157
vn -0.7071 -0.7071 -0.0000
vn -0.6709 -0.6709 0.3157
vn -0.6709 -0.3157 0.6709
vn -0.7071 -0.0000 0.7071
vn -0.6709 0.3157 0.6709
vn -0.6709 0.6709 0.3157
vn -0.7071 0.7071 -0.0000
vn -0.6709 0.6709 -0.3157
vn -0.6709 0.3157 -0.6709
vn -0.7071 -0.0000 -0.7071
vn -0.6709 -0.3157 -0.6709
vn 0.3157 -0.6709 -0.6709
vn -0.0000 -0.7071 -0.7071
vn -0.3157 -0.6709 -0.6709
vn -0.3157 0.6709 -0.6709
vn -0.0000 0.7071 -0.7071
vn 0.3157 0.6709 -0.6709
vn 0.6709 0.3157 -0.6709
vn 0.7071 -0.0000 -0.7071
vn 0.6709 -0.3157 -0.6709
vn 0.6709 -0.6709 0.3157
vn 0.7071 -0.7071 -0.0000
vn 0.6709 -0.6709 -0.3157
vn 0.6709 0.6709 -0.3157
vn 0.7071 0.7071 -0.0000
vn 0.6709 0.6709 0.3157
vn 0.6709 0.3157 0.6709
vn 0.7071 -0.0000 0.7071
vn 0.6709 -0.3157 0.6709
vn -0.3157 -0.6709 0.6709
vn -0.0000 -0.7071 0.7071
vn 0.3157 -0.6709 0.6709
vn 0.3157 0.6709 0.6709
vn -0.0000 0.7071 0.7071
vn -0.3157 0.6709 0.6709
vn -0.8797 -0.3362 0.3362
vn -0.9345 -0.0000 0.3560
vn -0.8797 0.3362 0.3362
vn -0.9345 -0.3560 -0.0000
vn -1.0000 -0.0000 -0.0000
vn -0.9345 0.3560 -0.0000
vn -0.8797 -0.3362 -0.3362
vn -0.9345 -0.0000 -0.3560
vn -0.8797 0.3362 -0.3362
vn -0.3362 -0.3362 -0.8797
vn -0.3560 -0.0000 -0.9345
vn -0.3362 0.3362 -0.8797
vn -0.0000 -0.3560 -0.9345
vn -0.0000 -0.0000 -1.0000
vn -0.0000 0.3560 -0.9345
vn 0.3362 -0.3362 -0.8797
vn 0.3560 -0.0000 -0.9345
vn 0.3362 0.3362 -0.8797
vn 0.8797 -0.3362 -0.3362
vn 0.9345 -0.0000 -0.3560
vn 0.8797 0.3362 -0.3362
vn 0.9345 -0.3560 -0.0000
vn 1.0000 -0.0000 -0.0000
vn 0.9345 0.3560 -0.0000
vn 0.8797 -0.3362 0.3362
vn 0.9345 -0.0000 0.3560
vn 0.8797 0.3362 0.3362
vn 0.3362 -0.3362 0.8797
vn 0.3560 -0.0000 0.9345
vn 0.3362 0.3362 0.8797
vn -0.0000 -0.3560 0.9345
vn -0.0000 -0.0000 1.0000
vn -0.0000 0.3560 0.9345
vn -0.3362 -0.3362 0.8797
vn -0.3560 -0.0000 0.9345
vn -0.3362 0.3362 0.8797
vn -0.3362 -0.8797 -0.3362
vn -0.0000 -0.9345 -0.3560
vn 0.3362 -0.8797 -0.3362
vn -0.3560 -0.9345 -0.0000
vn -0.0000 -1.0000 -0.0000
vn 0.3560 -0.9345 -0.0000
vn -0.3362 -0.8797 0.3362
vn -0.0000 -0.9345 0.3560
vn 0.3362 -0.8797 0.3362
vn 0.3362 0.8797 -0.3362
vn -0.0000 0.9345 -0.3560
vn -0.3362 0.8797 -0.3362
vn 0.3560 0.9345 -0.0000
vn -0.0000 1.0000 -0.0000
vn -0.3560 0.9345 -0.0000
vn 0.3362 0.8797 0.3362
vn -0.0000 0.9345 0.3560
vn -0.3362 0.8797 0.3362
vt 0.250000 0.250000
vt 0.500000 0.250000
vt 0.500000 0.500000
vt 0.250000 0.500000
vt 0.750000 0.250000
vt 0.750000 0.500000
vt 0.500000 0.750000
vt 0.250000 0.750000
vt 0.750000 0.750000
vt 0.000000 0.000000
vt 0.250000 0.000000
vt 0.000000 0.250000
vt 0.500000 0.000000
vt 0.750000 0.000000
vt 1.000000 0.000000
vt 1.000000 0.250000
vt 1.000000 0.500000
vt 1.000000 0.750000
vt 1.000000 1.000000
vt 0.750000 1.000000
vt 0.500000 1.000000
vt 0.250000 1.000000
vt 0.000000 0.750000
vt 0.000000 1.000000
vt 0.000000 0.500000
s 1
usemtl matSpeck
f 45/1/45 46/2/46 49/3/49 48/4/48
f 46/2/46 47/5/47 50/6/50 49/3/49
f 48/4/48 49/3/49 52/7/52 51/8/51
f 49/3/49 50/6/50 53/9/53 52/7/52
f 1/10/1 12/11/12 45/1/45 11/12/11
f 12/11/12 13/13/13 46/2/46 45/1/45
f 13/13/13 14/14/14 47/5/47 46/2/46
f 14/14/14 2/15/2 15/16/15 47/5/47
f 47/5/47 15/16/15 16/17/16 50/6/50
f 50/6/50 16/17/16 17/18/17 53/9/53
f 53/9/53 17/18/17 4/19/4 18/20/18
f 52/7/52 53/9/53 18/20/18 19/21/19
f 51/8/51 52/7/52 19/21/19 20/22/20
f 9/23/9 51/8/51 20/22/20 3/24/3
f 10/25/10 48/4/48 51/8/51 9/23/9
f 11/12/11 45/1/45 48/4/48 10/25/10
f 54/1/54 55/2/55 58/3/58 57/4/57
f 55/2/55 56/5/56 59/6/59 58/3/58
f 57/4/57 58/3/58 61/7/61 60/8/60
f 58/3/58 59/6/59 62/9/62 61/7/61
f 3/10/3 20/11/20 54/1/54 23/12/23
f 20/11/20 19/13/19 55/2/55 54/1/54
f 19/13/19 18/14/18 56/5/56 55/2/55
f 18/14/18 4/15/4 24/16/24 56/5/56
f 56/5/56 24/16/24 25/17/25 59/6/59
f 59/6/59 25/17/25 26/18/26 62/9/62
f 62/9/62 26/18/26 8/19/8 27/20/27
f 61/7/61 62/9/62 27/20/27 28/21/28
f 60/8/60 61/7/61 28/21/28 29/22/29
f 21/23/21 60/8/60 29/22/29 7/24/7
f 22/25/22 57/4/57 60/8/60 21/23/21
f 23/12/23 54/1/54 57/4/57 22/25/22
f 63/1/63 64/2/64 67/3/67 66/4/66
f 64/2/64 65/5/65 68/6/68 67/3/67
f 66/4/66 67/3/67 70/7/70 69/8/69
f 67/3/67 68/6/68 71/9/71 70/7/70
f 7/10/7 29/11/29 63/1/63 32/12/32
f 29/11/29 28/13/28 64/2/64 63/1/63
f 28/13/28 27/14/27 65/5/65 64/2/64
f 27/14/27 8/15/8 33/16/33 65/5/65
f 65/5/65 33/16/33 34/17/34 68/6/68
f 68/6/68 34/17/34 35/18/35 71/9/71
f 71/9/71 35/18/35 6/19/6 36/20/36
f 70/7/70 71/9/71 36/20/36 37/21/37
f 69/8/69 70/7/70 37/21/37 38/22/38
f 30/23/30 69/8/69 38/22/38 5/24/5
f 31/25/31 66/4/66 69/8/69 30/23/30
f 32/12/32 63/1/63 66/4/66 31/25/31
f 72/1/72 73/2/73 76/3/76 75/4/75
f 73/2/73 74/5/74 77/6/77 76/3/76
f 75/4/75 76/3/76 79/7/79 78/8/78
f 76/3/76 77/6/77 80/9/80 79/7/79
f 5/10/5 38/11/38 72/1/72 41/12/41
f 38/11/38 37/13/37 73/2/73 72/1/72
f 37/13/37 36/14/36 74/5/74 73/2/73
f 36/14/36 6/15/6 42/16/42 74/5/74
f 74/5/74 42/16/42 43/17/43 77/6/77
f 77/6/77 43/17/43 44/18/44 80/9/80
f 80/9/80 44/18/44 2/19/2 14/20/14
f 79/7/79 80/9/80 14/20/14 13/21/13
f 78/8/78 79/7/79 13/21/13 12/22/12
f 39/23/39 78/8/78 12/22/12 1/24/1
f 40/25/40 75/4/75 78/8/78 39/23/39
f 41/12/41 72/1/72 75/4/75 40/25/40
f 81/1/81 82/2/82 85/3/85 84/4/84
f 82/2/82 83/5/83 86/6/86 85/3/85
f 84/4/84 85/3/85 88/7/88 87/8/87
f 85/3/85 86/6/86 89/9/89 88/7/88
f 3/10/3 23/11/23 81/1/81 9/12/9
f 23/11/23 22/13/22 82/2/82 81/1/81
f 22/13/22 21/14/21 83/5/83 82/2/82
f 21/14/21 7/15/7 32/16/32 83/5/83
f 83/5/83 32/16/32 31/17/31 86/6/86
f 86/6/86 31/17/31 30/18/30 89/9/89
f 89/9/89 30/18/30 5/19/5 41/20/41
f 88/7/88 89/9/89 41/20/41 40/21/40
f 87/8/87 88/7/88 40/21/40 39/22/39
f 11/23/11 87/8/87 39/22/39 1/24/1
f 10/25/10 84/4/84 87/8/87 11/23/11
f 9/12/9 81/1/81 84/4/84 10/25/10
f 90/1/90 91/2/91 94/3/94 93/4/93
f 91/2/91 92/5/92 95/6/95 94/3/94
f 93/4/93 94/3/94 97/7/97 96/8/96
f 94/3/94 95/6/95 98/9/98 97/7/97
f 8/10/8 26/11/26 90/1/90 33/12/33
f 26/11/26 25/13/25 91/2/91 90/1/90
f 25/13/25 24/14/24 92/5/92 91/2/91
f 24/14/24 4/15/4 17/16/17 92/5/92
f 92/5/92 17/16/17 16/17/16 95/6/95
f 95/6/95 16/17/16 15/18/15 98/9/98
f 98/9/98 15/18/15 2/19/2 44/20/44
f 97/7/97 98/9/98 44/20/44 43/21/43
f 96/8/96 97/7/97 43/21/43 42/22/42
f 35/23/35 96/8/96 42/22/42 6/24/6
f 34/25/34 93/4/93 96/8/96 35/23/35
f 33/12/33 90/1/90 93/4/93 34/25/34

BIN
model/speck/speck.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

22
model/speck/speck2.mtl Normal file
View File

@ -0,0 +1,22 @@
# Blender 4.2.1 LTS MTL File: 'speck.blend'
# www.blender.org
newmtl matSpeck
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.500000
d 1.000000
illum 2
map_Kd speck.png
newmtl matSpeck.001
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.500000
d 1.000000
illum 2

2243
model/speck/speck2.obj Normal file

File diff suppressed because it is too large Load Diff

1
model/speck/white.data Normal file
View File

@ -0,0 +1 @@
��������������������������������������������������������������������������������������������������������������������������������

15
model/speck/white.data.h Normal file
View File

@ -0,0 +1,15 @@
#pragma once
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
extern uint32_t _binary_model_speck_white_data_start __asm("_binary_model_speck_white_data_start");
extern uint32_t _binary_model_speck_white_data_end __asm("_binary_model_speck_white_data_end");
extern uint32_t _binary_model_speck_white_data_size __asm("_binary_model_speck_white_data_size");
#ifdef __cplusplus
}
#endif

BIN
model/speck/white.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 B