by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Jason Miller
@imjasonmiller_twitter
@ArmandDu does the model load without react-three-renderer? I'd go from there. If you have the ref to the object as an escape hatch, you should be able to do anything that is possible in three.js
Or perhaps something changed between versions, not sure which version of three.js you're running
ArmandDu
@ArmandDu
"react-three-renderer": "^3.2.3",
"three": "^0.86.0",

In one of my component, I'm loading the .dae with "ColladaLoader.js" that I downloaded from here: https://github.com/mrdoob/three.js/tree/master/examples/js/loaders
Then inside the loader.load's callback, I extracted the scene from the result (result.scene) and give it to my Model Component.

I'm actually testing from what I saw on the repository's issues page. If you have a better solution I'll love to hear it @imjasonmiller_twitter !

ArmandDu
@ArmandDu
Ok, so now I've got it figured for the example. But it doesn't work with my custom collada. I think I need to check my export settings
ArmandDu
@ArmandDu
So, apparently it works with UV Mapping as long as I bundle the .dae and the images together. But still open for a better way to do it :)
Thanks Jason for your help!
Jason Miller
@imjasonmiller_twitter
Haha, awesome. Nice to hear you fixed it @ArmandDu
Jason Miller
@imjasonmiller_twitter
image.png
General question, but does anyone know if there is a name for the way the triangles are done on the right?
I used it in a game of mine and it provided better (more even) deformation for my low poly terrain
image.png
Jason Miller
@imjasonmiller_twitter
In both images above the center vertex is raised by the same amount
Jason Miller
@imjasonmiller_twitter
@toxicFork @andrewray_twitter perhaps?
bailihua93
@bailihua93
how about your project?
Arthur Schwaiger
@Colmea
Hey all, it's been a long time
@toxicFork are you still maintaining this project ? We are using your library in a new big project but we need to use React 16. Do you plan to upgrade to v16 ?
ArmandDu
@ArmandDu
Hey @Colmea have you seen this repo? https://github.com/toxicFork/react-three-renderer-fiber
Andrew Ray
@andrewray_twitter
test
Andrew Ray
@andrewray_twitter
With react 15, this may be obvious, but looks like stateless functions are a little faster than es6 classes https://jsperf.com/react-class-vs-component/1
not by much, but maybe relevant for people trying to squeeze perf out of r3r
Andrew Ray
@andrewray_twitter
i'm trying out a potential pattern to improve performance in R3R
shouldComponentUpdate always returns false, and also mutate ref values, like this.refs.mesh.position.copy(nextProps.position) in shouldComponentUpdate
Andrew Ray
@andrewray_twitter
@toxicFork I wonder if there's an abstraction to make this an automatic setup. define your components, set them all as refs, and copy props into each ref instead of calling render() to avoid making react do heavy diffing
Andrew Ray
@andrewray_twitter
I can't remember, is there a way to group <viewports> inside a scene?
Andrew Ray
@andrewray_twitter
gah i've seen this before but can't remember the resolution
Error: Could not find "store" in either the context or props of "Connect(TitleScreen)". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "Connect(TitleScreen)
except the root has provider
Nathan Bierema
@Methuselah96
toxicFork/react-three-renderer#140
You have to pass "store" as a prop. Wrapping it in the provider doesn't work.
Andrew Ray
@andrewray_twitter
@Methuselah96 nice, thanks
Andrew Ray
@andrewray_twitter
I broke up my react components and @connected each one instead of doing a top down @connect, so that I could update individual components and not all of them
specifically I was looking to avoid re-rendering the component that renders <React3> and top level stuff like <viewport>. however, after ripping everything apart and @connecting each, the performance gains are negligible
Andrew Ray
@andrewray_twitter
debugging fps is difficult - I get fluctuations and don't know what they're from
Andrew Ray
@andrewray_twitter
current game loop breakdown, while debugging, game state updating is 11ms (9 of which is physics step, 1 of which is a raycast), 6ms is updating the positions/rotations/etc of every object in my scene, 11ms is three.js rendering
Andrew Ray
@andrewray_twitter
current perf breakdown
three rendering is a slow boy
but also, the fact that it takes just as long to update the data in my scene tree (second green column) as it takes to actually produce that data (first purple column) is an issue
Andrew Ray
@andrewray_twitter
wow, what an irony. i recently discovered I have 400+ objects getting rendered by three, but my scene isn't that complex. it turns out the 444 objects are the pieces of my lightmapped mesh. i made a lightmapping mesh stitcher system so that I could bake a lightmap to a single mesh to improve performance. but apparently something about the way I do it is creating multiple meshes (one shader per wall or something), and all those pieces are increasing my render time 4-5x (while debugging, 11ms vs 2ms)
Firtina Ozbalikci
@toxicFork
Hey @andrewray_twitter ! Sorry just saw the messages above, the copying of props to refs sounds like it will remove a lot of overhead! I think it's a good way because it still allows you to get the main advantage of react (well, when you render to non-dom, and subjective) to set the scene up in the declarative way and do the updates whatever other way :)
The implementation may be tough... But could create a helper class to accept tagged refs and return them
Like <something ref={this, 'myThing')}>?
For the light mapped mesh, ow
Firtina Ozbalikci
@toxicFork
Yeah I guess light mapped stuff may need to all share one shader
Andrew Ray
@andrewray_twitter
happy to hear you're alive @toxicFork
Firtina Ozbalikci
@toxicFork
Haha sorry for the extended disappearance!
Andrew Ray
@andrewray_twitter
no worries, there's no pressure to respond to all things r3r 24/7. the library has already given me much joy up to this point
Firtina Ozbalikci
@toxicFork
I'm very happy to hear that! I still spend a few hours here and there for the 16+ upgrade and rewrite, when it comes it will solve a few more headaches I'm hoping
Andrew Ray
@andrewray_twitter
@toxicFork hmm, I would like to render a portal from inside a <react3>