2024-04-21 17:35:48 -04:00
|
|
|
// SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com>
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2024-04-30 18:12:02 -04:00
|
|
|
#include "texture.h"
|
|
|
|
|
2024-04-21 17:35:48 -04:00
|
|
|
struct RenderPart {
|
|
|
|
size_t numIndices;
|
|
|
|
|
2024-11-03 11:05:30 -05:00
|
|
|
Buffer vertexBuffer; // Only used in the simple renderer
|
|
|
|
Buffer indexBuffer;
|
|
|
|
std::vector<Buffer> streamBuffer; // Only used in the game renderer
|
2024-04-21 17:35:48 -04:00
|
|
|
|
|
|
|
int materialIndex = 0;
|
2024-11-03 11:05:30 -05:00
|
|
|
physis_Part originalPart;
|
2024-04-21 17:35:48 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
enum class MaterialType { Object, Skin };
|
|
|
|
|
|
|
|
struct RenderMaterial {
|
2024-04-27 12:29:19 -04:00
|
|
|
physis_Material mat;
|
2024-04-21 17:35:48 -04:00
|
|
|
MaterialType type = MaterialType::Object;
|
2024-05-27 13:15:40 -04:00
|
|
|
physis_SHPK shaderPackage{};
|
2024-04-21 17:35:48 -04:00
|
|
|
|
2024-04-30 18:12:02 -04:00
|
|
|
std::optional<Texture> diffuseTexture;
|
|
|
|
std::optional<Texture> normalTexture;
|
|
|
|
std::optional<Texture> specularTexture;
|
|
|
|
std::optional<Texture> multiTexture;
|
2024-04-27 18:44:53 -04:00
|
|
|
|
2024-05-10 15:53:32 -04:00
|
|
|
std::optional<Texture> tableTexture;
|
2024-04-30 19:05:55 -04:00
|
|
|
|
2024-04-27 18:44:53 -04:00
|
|
|
Buffer materialBuffer;
|
2024-04-21 17:35:48 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct DrawObject {
|
|
|
|
QString name;
|
|
|
|
|
|
|
|
physis_MDL model;
|
|
|
|
std::vector<RenderPart> parts;
|
2024-11-02 22:14:10 -04:00
|
|
|
std::array<glm::mat4, 768> boneData; // JOINT_MATRIX_SIZE_DAWNTRAIL
|
2024-04-21 17:35:48 -04:00
|
|
|
std::vector<RenderMaterial> materials;
|
|
|
|
glm::vec3 position;
|
|
|
|
bool skinned = false;
|
|
|
|
|
|
|
|
uint16_t from_body_id = 101;
|
|
|
|
uint16_t to_body_id = 101;
|
|
|
|
|
|
|
|
Buffer boneInfoBuffer;
|
2024-11-02 22:14:10 -04:00
|
|
|
};
|