Immediate mode?

Would it be possible to consider adding immediate mode to the conversion as well? This is more flexible and reduces the switch between using the unity editor and writing the code implementation in separate threejs, hopefully all in the unity editor!

Original Post on Discord

by user 417248803431776267

Hi, im not sure i understand the question - by immediate mode do you refer to the typescript to unity component compilation to run faster?

@marwie1 :cactus: It is the customized vertex data per frame that is transferred to the gpu for drawing, called immediate mode drawing

by user 417248803431776267

Not all models come from the dcc tool, some need to be generated in real time by the algorithm, which is actually a very practical approach

by user 417248803431776267

@Yu you can already use runtime geometry generation, but you do indeed have to write that in Typescript/Javascript using the three.js APIs.

Would you mind to explain a bit more what you’d like to see?

@herbst🌵 For example, if I want to realize the function of drawing a line, every frame I will record the position of the mouse and generate two vertices in the tangent direction to the drawing direction, I will record the generated vertices and calculate the corresponding index and uv, so that every frame I will pass the collected data to the gpu for them to render, that’s what I mean by the immediate drawing mode, I don’t know if it is possible to realize this kind of conversion? Surely there are methods that would be more inconvenient

by user 417248803431776267

Threejs is certainly capable of this kind of thing, I’m just wondering if it’s possible to convert directly to get the same result

by user 417248803431776267

Needle Engine doesn’t convert code directly, but helps with data setup and wiring things up. So you can e.g. have a “LineDrawer” component with certain settings and that is represented by a typescript component doing the drawing

OK, I’ll look into it later.

by user 417248803431776267