Skip to content

lth demo #30695

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

Merged
merged 5 commits into from
Mar 28, 2025
Merged

lth demo #30695

merged 5 commits into from
Mar 28, 2025

Conversation

lo-th
Copy link
Contributor

@lo-th lo-th commented Mar 9, 2025

Description

new demo for three js
webgl_animation_walk
webgl_random_uv
webgl_watch

update for webgl_gpgpu_water.html

Copy link
Contributor

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@Mugen87
Copy link
Collaborator

Mugen87 commented Mar 9, 2025

Thank your for your contributions but I'm afraid none of the example demonstrate a library feature that has not been demonstrated already. We also want to limit the number of examples, especially the ones using WebGLRenderer, because a lot of new examples for WebGPURenderer and TSL have been added.

Besides, we do not want to add any more examples using Material.onBeforeCompile() since the shader patching approach turned out to be fragile and error prone.

It's probably best if you share your demos at the forum in the Resource category.

@lo-th
Copy link
Contributor Author

lo-th commented Mar 9, 2025

is a mrdoob request but ok ...

@Mugen87
Copy link
Collaborator

Mugen87 commented Mar 9, 2025

Sure, I won't close the PR. It's up to @mrdoob to decide.

I bet it took quite some time to develop the examples so I can understand it's disappointing. But we have guidelines and it's important to honor them. Next time, it's maybe better to file an issue first and clarify if your planned demos can be added or not.

@lo-th
Copy link
Contributor Author

lo-th commented Mar 9, 2025

ok

@Makio64
Copy link
Contributor

Makio64 commented Mar 11, 2025

the webgpu water update looks great !

@mrdoob
Copy link
Owner

mrdoob commented Mar 17, 2025

I'll look into it this one this week 🙏

@mrdoob mrdoob added this to the r175 milestone Mar 28, 2025
@mrdoob mrdoob merged commit 7d5abde into mrdoob:dev Mar 28, 2025
11 checks passed
Comment on lines +327 to +328
borderGeom.receiveShadow = true;
borderGeom.castShadow = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these be set on poolBorder instead? TorusGeometrys don't have these properties.

Copy link
Owner

Choose a reason for hiding this comment

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

@lo-th I think so?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes sure is fixe

shader.uniforms['useSuslikMethod'] = { value: 0 };
shader.uniforms['debugNoise'] = { value: 0 };

shader.fragmentShader = shader.fragmentShader.replace( '#include <clipping_planes_pars_fragment>', '#include <clipping_planes_pars_fragment>' + randomUV );
Copy link
Collaborator

@Mugen87 Mugen87 Mar 28, 2025

Choose a reason for hiding this comment

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

@mrdoob I really struggle with adding new examples that perform this kind of shader patching approach with WebGLRenderer. This turned out to be too error-prone.

The new examples should use WebGPURenderer and TSL.

In general, I would prefer to revert the PR since the new demos demonstrate no engine features that have already been demonstrated in the existing examples. They just add additional maintenance overhead, imo. I have thought we wanted to address this issue and minimize the amount of example code that we have in the repo.

Copy link
Owner

@mrdoob mrdoob Mar 28, 2025

Choose a reason for hiding this comment

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

First of all, sorry that I didn't respond to explain all this sooner.

I don't know if you've been following what has been happening for the last month(s) with "vibe coding" and the AIs writing three.js apps in a matter of seconds... The community management work on Twitter has been pretty intense (I even had a mild panic attack at some point).

Reason 1

I totally agree about the maintenance burden, but the examples we have are also starting to look pretty outdated visually. In fact, some of the examples make the library look bad. So I think we must improve them visually or replace them with better ones.

I had bumped into @lo-th's examples a bunch of times and I thought they looked great and made the library look better than our own examples, so I asked him if he would be interested in contributing some of them and luckily he was up for it 🙏

I thought webgl_animation_walk could replace webgl_loader_md2_control. It's simpler and uses gltf instead of md2.

I thought webgl_random_uv was very beautiful and it would be great if we could have our own three.js-branded material ball, plus it's only 200KB.

I thought webgl_watch was also very beautiful and it's only 600KB. And the fact that the watch displays the actual time is the cherry on top!

And then the improvements to webgl_gpgpu_water just made the example looks so much better.

Reason 2

For years I've tried to include screenshots of the new features in the announcement tweets. Sometimes this process can be hard because we have not done any visual changes, only bug fixes or refactorings.

This got additionally tricky when I started last month doing a video instead.

If you look at the changelog for this month's release, the only visual change we had was webgpu_skinning_points. So having new examples was great for this too.

ShaderMaterial

TSL is definitely the future. And I'm also not a fan of the old error-prone approach.

Unfortunately we can't force the community to ditch everything they've done and start from scratch with TSL.

However, the more I use cursor the more viable I see that we can leverage AI to do something like a LegacyShaderMaterial for WebGPU that transpiles the glsl to tsl at render time and help more people move to WebGPURenderer without losing their custom shader work.

Have you tried asking cursor to add missing features to GLSLDecoder and TSLEncoder?

I'm also planning on asking the AIs for suggestions on how to get TSL working with WebGLRenderer.
I bet Gemini 2.5 Pro will have interesting solutions.

More on AI assisted development

I've been using AI since #25721. For that one I asked ChatGPT4 how to implement multi uv support. It told me all the files I had to modify and what to change. I didn't do exactly how the AI suggested, but it was a great start.

That was 2 years ago. Nowadays AIs are much more powerful and they can do a lot of stuff for us.

/cc @sunag @gkjohnson

Copy link
Owner

Choose a reason for hiding this comment

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

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.

5 participants