Comments (6)
Hey @alvarosabu ,
The approach you mention would work for the render phase. But ideally here, this needs to keep a few other things from happening too early.
We should avoid at least one of these until the system is ready:
- starting the loop
- calling any loop callbacks
If we do either of those, there's no need to modify the render phase specifically.
I'm working on a fix.
from tres.
Hey @alvarosabu !
I saw that you labelled this as PR welcome
. Great! I'll be happy to submit a PR eventually.
For now, I'm trying to submit issues highlighting rough spots encountered while building things with Tres.
My hope is that in assembling the issues, we'll be able to knock all (or most) of them out at once.
from tres.
Related?
This issue maybe pops up with custom shaders and HMR.
When doing off-screen rendering using a custom shader, this error is thrown on HMR:
![Screenshot 2024-04-04 at 15 13 25](https://private-user-images.githubusercontent.com/20469369/319598896-06cb6e48-c9bc-4b41-bf5d-cd25ba699653.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE1NTI3NzUsIm5iZiI6MTcyMTU1MjQ3NSwicGF0aCI6Ii8yMDQ2OTM2OS8zMTk1OTg4OTYtMDZjYjZlNDgtYzliYy00YjQxLWJmNWQtY2QyNWJhNjk5NjUzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIxVDA5MDExNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY3ODlhOGRhYTc0MjUwMWM0ZjRjMTk4NGRkYmIyYmNlYTEwNTBiN2Y4ZjdkZTZkMDk5NTdlMmE0MDg4ZWZmYTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0._s5XJW6sl5bOm-PDjoIFsCcM0Q6-Y8-iByM6p41PXgc)
from tres.
This usecase is covered by the new useLoop
composable available on v4
https://docs.tresjs.org/api/composables.html#useloop
from tres.
Hey @alvarosabu ,
This is still an issue with useLoop
in the latest v4
, as far as I can see. If you modify the code from the docs like this:
let logged = false
const { off } = render(({ renderer, scene, camera }) => {
if (!logged) {
logged = true
console.log("canvas width/height:", renderer.domElement.width, renderer.domElement.height)
console.log(`camera.aspect: ${camera.aspect}`);
}
renderer.render(scene, camera)
})
It will log this:
canvas width/height: 0 0
camera.aspect: 1
As with v3
these initial values will be changed on the next tick.
from tres.
OHHHH ok I see @andretchen0 we could add a check that if the size is !=0 it does render here:
tres/src/composables/useTresContextProvider/index.ts
Lines 196 to 199 in 8d53bba
from tres.
Related Issues (20)
- `Event` is not triggered in `TresGroup` HOT 2
- Impossible to `inject` variable in canvas child component HOT 4
- intersect only objects with events registered HOT 3
- No more outlines since V4 HOT 8
- TresInstancedMesh breaks with a dynamic instance count HOT 14
- Nested component not rendering HOT 2
- Deltatime Documentation Inaccuracy
- Rigged models are squished and broken HOT 3
- How to use vue-cli HOT 3
- Mesh that are delayed Join in the scene cannot trigger events HOT 4
- Sprite - Raycast events not firing if inside group HOT 5
- `TresPerspectiveCamera` `lookAt` not working with `CameraControls` HOT 3
- Recipe using `tweakpane`
- Events not registering on dynamically added objects HOT 2
- Library override the DPR setting in autonomy without chances to clamp / control it HOT 2
- Component: The setting parameter disableRender of TresCanvas is ineffective when renderMode is set to always. HOT 2
- Docs/playgrounds: change `ref(TresObject)` to `shallowRef(TresObject)` HOT 1
- When there is an annotated tag, the children of the scene will generate _Object3D model information HOT 1
- [Vue warn]: onUnmounted ... after upgrading to `4.2.0` - cached model fails to reload
- Vscode intellisense autocompletion not getting Tres components props
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tres.