RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.17k stars 1.24k forks source link

RenderEngineGl can consume glTF files #21520

Closed SeanCurtis-TRI closed 1 week ago

SeanCurtis-TRI commented 4 weeks ago

The main work is done by the GltfMeshExtractor defined in internal_render_engine_gl.cc. It extracts data from the glTF file and directly inserts it into RenderEngineGl's various geometry and mesh caches and informs the instantation of those canoncial meshes.

This also includes the ability to use textures that are defined in memory instead of reading them from the disk (in support of embedded textures).

Further allowances are made for glTF peculiarities:

Finally, update the supported file format documentation to provide guidance on using glTF files with RenderEngineGl.

Relates #20185.


This change is Reviewable

SeanCurtis-TRI commented 1 week ago
Previously, xuchenhan-tri wrote…
This PR is over the 1500 line limit. Can you provide some argument for why this needs to go in in one piece?

Please select whichever arguments you like most:

  1. It was below the line before feature review. :)
  2. It's barely over 1500 lines.
  3. There's no meaningful decomposition. The changes to internal_render_engine_gl (.h, .cc, and _test.cc) is the vast majority of everything in this test. Even if I removed everything else, we'd still be north of 1300 lines. So, chopping this up won't make the PR particularly easier to consume.
SeanCurtis-TRI commented 1 week ago
Previously, rpoyner-tri (Rick Poyner (rico)) wrote…
I'd say option 1 or 2, could be persuaded by either one. Option #3 (DRAKE_DEMAND reachable from even proposterous input) is the one I'd like to avoid.

Well, given that I've written the tests, I'll probably leave them and remove the documentation that says I'm not documenting it.