Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions include/madrona/importer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ struct SourceMaterial {
// If this is -1, no texture will be applied. Otherwise,
// the color gets multipled by color of the texture read in
// at the UVs of the pixel.
int32_t textureIdx;

int32_t *textureIdx;
uint32_t numTextures;
float roughness;
float metalness;
};
Expand All @@ -66,8 +66,7 @@ class ImageImporter {
ImageImporter(ImageImporter &&);
~ImageImporter();

using ImportHandler =
Optional<SourceTexture> (*)(void *data, size_t num_bytes);
using ImportHandler = Optional<SourceTexture> (*)(void *data, size_t num_bytes);

int32_t addHandler(const char *extension, ImportHandler fn);

Expand Down Expand Up @@ -106,9 +105,9 @@ struct ImportedAssets {

DynArray<SourceObject> objects;
DynArray<SourceMaterial> materials;
DynArray<int32_t> materialTextures;
DynArray<SourceInstance> instances;
DynArray<SourceTexture> textures;

};

class AssetImporter {
Expand Down
3 changes: 2 additions & 1 deletion include/madrona/mesh_bvh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ struct Material {
// For now, just a color
math::Vector4 color;

int32_t textureIdx;
int32_t textureOffset;
uint32_t numTextures;

float roughness;
float metalness;
Expand Down
5 changes: 3 additions & 2 deletions include/madrona/render/cuda_batch_render_assets.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ struct MeshBVHData {
struct MaterialData {
// GPU buffer containing array of texture objects
cudaTextureObject_t *textures;
uint32_t numTextureBuffers;
cudaArray_t *textureBuffers;
uint32_t numMipmapTextureBuffers;
uint32_t numTextureBuffers;
cudaMipmappedArray_t *mipmapTextureBuffers;
uint32_t numMipmapTextureBuffers;
int32_t *materialTextures;
Material *materials;
};

Expand Down
179 changes: 74 additions & 105 deletions src/bridge/bindings.cpp

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions src/bridge/gs_madrona/renderer_gs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def __init__(
geom_retriever: GeomRetriever,
gpu_id: int,
num_worlds: int,
num_cameras: int,
num_lights: int,
cam_fovs_tensor: torch.Tensor,
cam_znears_tensor: torch.Tensor,
Expand All @@ -44,7 +43,7 @@ def __init__(
assert geom_retriever is not None, "GeomRetriever is required for MadronaBatchRendererAdapter"
assert gpu_id >= 0, "GPU ID must be greater than or equal to 0"
assert num_worlds > 0, "Number of worlds must be greater than 0"
assert num_cameras > 0, "Must have at least one camera for Madrona to work!"
assert cam_fovs_tensor.shape[0] > 0, "Must have at least one camera for Madrona to work!"
assert batch_render_view_width > 0, "Batch render view width must be greater than 0"
assert batch_render_view_height > 0, "Batch render view height must be greater than 0"

Expand Down Expand Up @@ -72,7 +71,6 @@ def __init__(
gpu_id=gpu_id,
**geom_args_static,
num_lights=num_lights,
num_cams=num_cameras,
num_worlds=num_worlds,
batch_render_view_width=batch_render_view_width,
batch_render_view_height=batch_render_view_height,
Expand Down
Loading