kurono, Sr. Member Posted: 18 March 2012 03:54 AM Total Posts: 103
Since v4 LODObject was missed. It would be nice to restore this class. For massive scenes the advantages of such approach are clear.
kurono, Sr. Member Posted: 18 March 2012 07:22 AM Total Posts: 103
[ # 1 ]
Of course, anyone can use custom LOD according to current perspective:
var m:Mesh; // your mesh var aabb:BoundingVolumeBase = m.bounds; var center:Vector3D = new Vector3D(); center = new Vector3D( aabb.min.x + (aabb.max.x - aabb.min.x) / 2, aabb.min.y + (aabb.max.y - aabb.min.y) / 2, aabb.min.z + (aabb.max.z - aabb.min.z) / 2); var focus:Number = direction.length;
... onEnterFrame:
var perspective:Number = 1 / (1 + m.modelViewProjection.rawData[14] / focus); if (perspective < .5) { // draw crude model } else { // draw hi-detailed model }
Baush, Sr. Member Posted: 01 April 2012 07:08 PM Total Posts: 135
[ # 2 ]
Hi Kurono, in your example, what does the “direction” variable points to?
Thanks
kurono, Sr. Member Posted: 01 April 2012 09:34 PM Total Posts: 103
[ # 3 ]
It’s distance between “camera.position” and the “center” variable.
GoroMatsumoto, Sr. Member Posted: 10 July 2013 12:21 PM Total Posts: 166
[ # 4 ]
Hi.
I hope that LOD(& LOD terrain) comes in Away3D.
We can already use CascadeShadowMap.
So, if we can use some LOD system with the shadow,
it will bring us a possibility of creating a open world game with Away3D.
That’s very interesting and exiting.
Cheers.
80prozent, Sr. Member Posted: 10 July 2013 03:57 PM Total Posts: 430
[ # 5 ]
yes - i think LOD would be a very good thing to have.
we have a StaticlightPicker, so maybe this is where a DynamicLightPicker could get into play….
Line Effect, Newbie Posted: 23 July 2013 04:33 PM Total Posts: 4
[ # 6 ]
I hope we can have these classes
we are already using Away3d and when it comes to large layout we do not have any other choice except using Alternativa3D.
which does not give us the same quality because we are not focusing on Alternativa3D much.
Also Sea3D is making life so so easy with Away3D
Please do this guys, or if anyone can build these classes for the Away community
i hope…
Line Effect, Newbie Posted: 24 July 2013 07:11 PM Total Posts: 4
[ # 7 ]
Hello Guys
i have made 2 containers and added them to the scene
the 1st container contains the high poly models
the 2nd container contains the low poly models
then load them both into the scene
then i have added this for loop in the render EnterFrame loop
for (var m:int = 0; m < scene.numChildren; m++) { for (var i:int = 0; i < scene.getChildAt(m).childrens.length; i++) { var Distance:Number = Vector3D.distance(scene.getChildAt(m).childrens[i].position,view.camera.position); //trace(scene.getChildAt(m).childrens[i].name,Distance); if (scene.getChildAt(m).childrens[i].name.search("Spot") < 0) { if (scene.getChildAt(m).childrens[i].name.search("Camera01") < 0) { if (Distance <= 60) { if (m == 2) { scene.getChildAt(m).childrens[i].visible = false; } else { scene.getChildAt(m).childrens[i].visible = true; } } else { if (m == 1) { scene.getChildAt(m).childrens[i].visible = true; } else { scene.getChildAt(m).childrens[i].visible = false; } } } } }
this will allow the high poly models to appear when its close to the camera by the distance you specified, and the low poly models to appear when its far of the camera by more than distance you specified
it works for us till now well
if anyone has any other solution, so please share it
[VERY VERY VERY VERY SLOW, with complex models, the loop takes all the memory]
back to zero point again
dtramer2, Newbie Posted: 08 September 2013 05:31 AM Total Posts: 16
[ # 8 ]
the loop takes all the “memory”, or is it cpu?
if it is the distance calc that is taking a long time then you can optimize that.
Line Effect, Newbie Posted: 08 September 2013 11:26 PM Total Posts: 4
[ # 9 ]
yes taking the CPU
i have alot of models in the scene, so to make this check in every frame the file gets very heavy and navigation is sooo slow
i have another class to handle LOD by using awayPhysics , its much easier, and has no effect on the CPU. by collision detections
but i hope someone can do LOD class to handle it inside away3D
by the way Alternativa3D has LOD class , you can look into it and imitate it, but i can not really understand how it works, so again i hope someone will do it for us