Merged
Conversation
📊 Bundle Size Comparison📈 Summary
📋 Bundle Size Comparison
|
|
pkg.pr.new packages benchmark commit |
| const material = new THREE.MeshBasicNodeMaterial(); | ||
|
|
||
| +const albedo = TSL.color('magenta').mul(0.5); | ||
| +const albedoAccess = t3.fromTSL(albedo, d.vec3f); |
Contributor
There was a problem hiding this comment.
fromTSL does not work insinde TGSL, right? Is the error descriptive? Maybe we should mention it around here
Collaborator
Author
There was a problem hiding this comment.
From what I remember, it works inside TGSL just fine 👀
Collaborator
There was a problem hiding this comment.
Yes, it does work
material.positionNode = t3.toTSL(() => {
'use gpu';
return t3.fromTSL(TSL.positionLocal, d.vec3f).$
.mul(scaleBuffer.$[t3.instanceIndex.$])
.add(posBuffer.$[t3.instanceIndex.$]);
});| const springForce = springForceBuffer.$[springId]; | ||
| const springVertexIds = springVertexIdBuffer.$[springId]; | ||
| const factor = std.select(-1, 1, springVertexIds.x === idx); | ||
| force = force.add(springForce.mul(d.f32(factor))); |
Contributor
There was a problem hiding this comment.
When rewriting three.js code to TGSL, I accidentally rewrote:
const position = positionsBuffer.element(i);
position.addAssign(1);to
const position = positionsBuffer.$[i];
position += 1;I think some new users may come across this. Maybe we should include a warning about this caveat in the docs?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.