Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Firtina Ozbalikci
@toxicFork
Hmm
Could hack it somehow yes :D
Like inject the multi materials as the array? (...)
Andrew Ray
@andrewray_twitter
something like <Wall materialId1="brick" materialId2="stone" /> with the main takeway being i'm using strings for mat ids, and those mats exist in my resources
i'm going to manually construct the MultiMaterial in the component
I just don't want to re-make how I look up textures/shaders in the component, which I already have available in the resources
Andrew Ray
@andrewray_twitter
Parent already has a material defined !
i'm assigning this.refs.child.refs.mesh.material =
does that conflict with r3r?
Firtina Ozbalikci
@toxicFork
Argh, r3r being too possessive
Andrew Ray
@andrewray_twitter
I could make the mesh entirely in didMount
Firtina Ozbalikci
@toxicFork
yeah that may need to be necessary :(
Andrew Ray
@andrewray_twitter
multi-material.gif
multi material worked :)
Firtina Ozbalikci
@toxicFork
:clap:
i love the dynamic parts of the scene, lively!
so did you create the mesh entirely?
Andrew Ray
@andrewray_twitter
yeah =\
Firtina Ozbalikci
@toxicFork
not too bad!
if it works, that's good!
Andrew Ray
@andrewray_twitter
i've also started doing this, doing updates entirely in shouldUpdate and blocking render https://gist.github.com/AndrewRayCode/06a05b8a533d4b41d425ec86fbffa66f
Firtina Ozbalikci
@toxicFork
is this for perf purposes
or because multi mats are not supported?
Andrew Ray
@andrewray_twitter
for perf
Firtina Ozbalikci
@toxicFork
hmm!
Andrew Ray
@andrewray_twitter
it seems like one call to React.createElement is a lot of fn calls under the hood, maybe 10-20 before it even gets to the next shouldComponentUpdate
Firtina Ozbalikci
@toxicFork
yeah... :/
Andrew Ray
@andrewray_twitter
huge stacks every time nested react elements are rendered, and that's my app's main bottlneck
Firtina Ozbalikci
@toxicFork
i'm probably going to write a "compile react to non-react" project soon
Andrew Ray
@andrewray_twitter
reducing the number of times the code gets to createElement is a hack i'm trying to preempt that
interesting
Firtina Ozbalikci
@toxicFork
like, it'd extract components to non-react objects and do the updates directly
LOTS of magic
need to still wrap state and handle nesting etc, gonna be... fun.
Andrew Ray
@andrewray_twitter
in my case, 99% of my scene updates are using the same jsx structure, I just need to update props. setting up the whole scene graph in react is great, but then it's not needed until something is added or removed
Firtina Ozbalikci
@toxicFork
yeah :)
I'm thinking somehow to couple state and render more directly, and then from that coupling extract a render graph out and skip createElement entirely
super hard to describe, but may be worth it
long story short: "react is great for development but can be improved a lot for production"
(also need to sell the idea to facebook :D)
Andrew Ray
@andrewray_twitter
haha
Firtina Ozbalikci
@toxicFork
i have to use windows WPF for one project, and.. the xaml stuff is "quite close to react" but I'm missing the dynamic parts :p
sadly XAML is more like angularjs than react :violin:
on that note, going to sleep... take care :)
Andrew Ray
@andrewray_twitter
:wave:
Jason Miller
@imjasonmiller_twitter
test!
ArmandDu
@ArmandDu
Hello,
I've started a project in Three.js and as I'm a bit familiar with React, I started to use react-three-renderer at the same time :)
I find it really nice, thank you @toxicFork ! Unfortunately, since I'm quite new to ThreeJS (and WebGL) I have a lot of questions. Is Gitter a good place to start or is there another community where I should ask for help?
Thank you!
Jason Miller
@imjasonmiller_twitter

@ArmandDu for react-three-renderer I guess this is the best place to be :-)

There also is Stackoverflow and three.js also has its own places where you can find help. From their main page:

Nathan Bierema
@Methuselah96
Most people get a response on here fairly quickly if you have questions.
ArmandDu
@ArmandDu
Hey ! Thanks @imjasonmiller_twitter & @Methuselah96 :)