gnarlyman at March 29th, 2012 15:20 — #1
I've recently been working on developing a vertice system (i.e., the ol' X-Y-Z axis dealio) which deals in percentages versus hard-'n fast (hard-coded) vertice points. Basically, it would allow one to describe all objects in the game world by the numerical equivalency of the view box (0,0,0 to 1,1,1, or whatnot), where powers of ten would be the arbiter of scale for all objects. What I'm looking at doing is...
I know this perhaps sounds like an odd Q, but I know what I'm doing in theory, just not in actual, well, how-to-go-about-actual-implementation stuff. If the above doesn't make sense yet, feel free to ask Q's, and I'll continue to clarify.
geon at March 29th, 2012 15:33 — #2
What is the problem you are solving with this? I don't quite get it.
It seems to me, you won't need to do any programming at all. Just edit your models to stay within the 0-1 box and scale them apropriatwly in Unity. Or did I miss something?
gnarlyman at March 29th, 2012 16:08 — #3
The thing I'm seeking to do is to create a more unified system of 3D data representation so I can immediately tie all objects in the game world in a highly related manner and skip some of the matrix conversions. I'm designing the system so I can create vertices and polygons on-the-fly based on certain logic. I basically want this logic to run as a "mini-engine" that interfaces with the brute-force polygon/vertex pipeline within Unity. Obviously, since new vertices and polygons will will be constantly created/"uncreated", I need a way to feed in-feed out, to the "mini-engine", the percentage vertex points which Unity can then treat as hard-coded vertices. I'd like to bypass one of the matrix conversions as I previously mentioned. Since I'm still figuring out Unity scripting and all, perhaps such a thing is much easier to do than I'm currently seeing.
reedbeta at March 29th, 2012 16:58 — #4
geon at March 30th, 2012 04:07 — #5
I don't know if Unity lets you get source-code access to the point where you could add your own code to the engine itself, but if that's the kind of task you need to do, that's the only way I would go about it.
You can, but it's expensive.
geon at March 30th, 2012 04:14 — #6
skip some of the matrix conversions
Is this the optimization you want to do?
Matrices are always combined, so even if your objects needs to go through hundreds of transformations, they are combined into one, which is multiplied by each vertex.
You won't save anything.
stainless at March 30th, 2012 04:31 — #7
All you are doing by storing vertices as fractions of a unit volume is adding another transformation into the pipeline.
After all, unless ALL your objects fit within a unit sphere, you are going to have to scale them at some point.
If you were writing an engine from scratch, this could be very cheap indeed, but within an existing pipeline you are just adding another matrix multiply.
gnarlyman at April 3rd, 2012 17:54 — #8
Thanks peoples, very helpful. Pretty much answers my Q.