Skip to content

Commit

Permalink
Add a tutorial teaching about lighting in Drake
Browse files Browse the repository at this point in the history
This includes a number of resource files (illustrations, models, environment
maps, etc.) In addition, it includes the source files from which these
where generated (where reasonable).

TODO:
 - Add more illustrations (e.g., fitting shadow maps to scene.
 - Resolve file management
  • Loading branch information
SeanCurtis-TRI committed Feb 25, 2025
1 parent 1a91f07 commit bb28cee
Show file tree
Hide file tree
Showing 20 changed files with 4,586 additions and 1 deletion.
8 changes: 7 additions & 1 deletion geometry/meshcat.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,13 @@
connection.onmessage = (msg) => handle_message(msg);
connection.onopen = (evt) => {
if (!accepting_connections) location.reload();
accepting_connections = false
accepting_connections = false;
// Immediately trigger the callback so that connection is sufficient
// to register a pose (otherwise, it doesn't happen until *something*
// else happens to trigger a render). Invoking the render callback is
// always safe because even if `tracked_camera` isn't enabled, the
// Viewer has a non-null no-op callback set.
viewer.render_callback();
};
connection.onclose = function(evt) {
status_dom.style.display = "block";
Expand Down
23 changes: 23 additions & 0 deletions tutorials/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ load("//tools/jupyter:jupyter_py.bzl", "drake_jupyter_py_binary")
load("//tools/lint:lint.bzl", "add_lint_tests")
load("//tools/skylark:drake_py.bzl", "drake_py_test")

filegroup(
name = "resources",
data = [
"resources/sphere.gltf",
"resources/sphere.bin",
"resources/env_color_room.png",
"resources/env_color_room_75.hdr",
"resources/env_color_room_150.hdr",
"resources/env_color_room_1200.hdr",
],
)

drake_jupyter_py_binary(
name = "authoring_leaf_systems",
add_test_rule = 1,
Expand All @@ -19,6 +31,17 @@ drake_jupyter_py_binary(
],
)

drake_jupyter_py_binary(
name = "configuring_lighting",
add_test_rule = 1,
data = [
"resources",
],
deps = [
"//bindings/pydrake",
],
)

drake_jupyter_py_binary(
name = "custom_gradients",
add_test_rule = 1,
Expand Down
Loading

0 comments on commit bb28cee

Please sign in to comment.