Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add cubemap reflection example, *breaking* - remove .populate method #1017

Merged
merged 53 commits into from
Apr 10, 2025

Conversation

reczkok
Copy link
Collaborator

@reczkok reczkok commented Mar 13, 2025

closes #969
closes #745

Caution

This branch introduces a breaking change by removing the deprecated .populate method

@reczkok reczkok force-pushed the feat/game-of-disco branch from dd3082e to ed717ee Compare March 13, 2025 22:07
Copy link

github-actions bot commented Mar 13, 2025

pkg.pr.new

packages

pnpm i https://pkg.pr.new/software-mansion/TypeGPU/typegpu@1017
pnpm i https://pkg.pr.new/software-mansion/TypeGPU/typegpu@6ef1460d34fdeaa7e7e714b8db02f107f4d5d002

benchmark
view benchmark

commit
view commit

@reczkok reczkok force-pushed the feat/game-of-disco branch 2 times, most recently from 87b6bdf to 0a168fd Compare March 20, 2025 16:49
@reczkok reczkok force-pushed the feat/game-of-disco branch from f2836ee to 55cda14 Compare March 31, 2025 12:42
@reczkok reczkok marked this pull request as ready for review March 31, 2025 16:17
@iwoplaza
Copy link
Collaborator

iwoplaza commented Apr 1, 2025

Could we move the cubemap to public/assets/cubemap-reflection, to match the other examples? Also, what's the source and license for that cubemap?

@reczkok
Copy link
Collaborator Author

reczkok commented Apr 1, 2025

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new cubemap reflection example while updating the internal API to use a unified Snippet type instead of Resource. Key changes include:

  • Refactoring internal type definitions and function signatures from Resource to Snippet.
  • Adding new packing/unpacking utilities and updating unstruct implementation.
  • Integrating a new vector slider control component for improved UI in the docs example.

Reviewed Changes

Copilot reviewed 30 out of 32 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/typegpu/src/std/index.ts Added new exports for packing/unpacking functions.
packages/typegpu/src/smol/wgslGenerator.ts Updated type signatures from Resource to Snippet.
packages/typegpu/src/smol/generationHelpers.ts Updated type usage to Snippet.
packages/typegpu/src/shared/generators.ts Adjusted generic type mappings to Snippet.
packages/typegpu/src/resolutionCtx.ts Replaced Resource with Snippet in context methods.
packages/typegpu/src/data/unstruct.ts Refactored unstruct implementation and updated return types.
packages/typegpu/src/data/offsets.ts Updated type constraint to include AnyUnstruct.
packages/typegpu/src/data/index.ts Added new export for AnyVecInstance.
packages/typegpu/src/data/dataTypes.ts Modified Unstruct interface with additional properties.
packages/typegpu/src/core/vertexLayout/vertexAttribute.ts Changed import to use AnyUnstruct.
packages/typegpu/src/core/function/fnCore.ts Updated function parameter and return types to Snippet.
apps/typegpu-docs/src/utils/examples/exampleControlAtom.ts Added new type for vector slider control (note potential naming inconsistency).
apps/typegpu-docs/src/content/examples/rendering/cubemap-reflection/*.ts New cubemap reflection example implementation and supporting helper functions.
apps/typegpu-docs/src/components/design/VectorSlider.tsx Added a new vector slider component for controlling vector parameters.
apps/typegpu-docs/src/components/ControlPanel.tsx Integrated the new vector slider control into the control panel.
Files not reviewed (2)
  • apps/typegpu-docs/src/content/examples/rendering/cubemap-reflection/index.html: Language not supported
  • apps/typegpu-docs/src/content/examples/rendering/cubemap-reflection/meta.json: Language not supported

@reczkok reczkok requested a review from Copilot April 3, 2025 15:44
Copilot

This comment was marked as resolved.

Copy link
Collaborator

@mhawryluk mhawryluk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome!

There's an error when switching to another example:
Zrzut ekranu 2025-04-7 o 13 02 43

@reczkok
Copy link
Collaborator Author

reczkok commented Apr 8, 2025

There's an error when switching to another example: Zrzut ekranu 2025-04-7 o 13 02 43

Should be fixed 🛠️

Copy link
Collaborator

@iwoplaza iwoplaza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REFLECT 🪩🪩🪩

@reczkok

This comment was marked as resolved.

@reczkok reczkok changed the title feat: Add cubemap reflection example feat: Add cubemap reflection example, *breaking* - remove .populate method Apr 10, 2025
@reczkok reczkok merged commit ea1079a into main Apr 10, 2025
6 checks passed
@reczkok reczkok deleted the feat/game-of-disco branch April 10, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chore: Rename Resources to Snippets Environmental cubemap with a reflective sphere example
4 participants