ParallelGraphics Forums
Browsers
You are here: [Forums]::[Browsers]

Registration 
Registration
Forgot your password?

Help 
Help
Support

Quick search 

Subscribe to newsletters 

Install Cortona VRML Client for FREE!
Outline 3D
3D Page Of the Week
email:  password:
  Browsers

Subject: Script nodes inside Group affecting performance
Sender: Alexander Podshivalov 10.08.10 07:50

I continue to optimize my machine-generated scenes, the main concern still is the initial rendering time. I have noticed some strange performance-affecting behaviour, which I cannot explain.

My scene is organised as follows:

First, PROTO definitions, the PROTOs describe some complex objects, e.g. "A panel house with roof". The PROTOs behaviour mimics the default VRML objects behaviour in some way, for example, PROTO named "Panel_house" has a field named floors and an eventIn set_floors, which are routed to corresponding field and eventIn of the script. The PROTO contains a Group node, which children include all the geometry and appearance of the model and a Script node, which does all the calculations and updates the Group children.

Then, a very long list of this PROTO being instantiated follows, each instance contains different coordinates and parameters. They all are DEFed like Obj_123, so they can be updated through VRML Automation (when the map, from which the objects are created, is updated on the server).

So, when the PROTO looks like this:

PROTO PanelHouse[
field SFSomething Param1
...

eventIn SFSomething set_Param1
...
]{
Group{
children[
DEF ChildOne Shape{}
...
]
}

DEF Script Script{
field SFSomething Param1 IS Param1
...
eventIn SFSomething set_Param1 IS set_Param1
...
eventOut SFSomethingElse ChildOneParam
...
url "javascript:do_something"
}

ROUTE Script.ChildOneParam TO ChildOne.set_Param
...
}

it works with satisfactory speed. If we change the PROTO, putting the Script into a Group, the startup speed slows in two times.

PROTO PanelHouse[
field SFSomething Param1
...

eventIn SFSomething set_Param1
...
]{
Group{
children[
DEF ChildOne Shape{}
...


DEF Script Script{
field SFSomething Param1 IS Param1
...
eventIn SFSomething set_Param1 IS set_Param1
...
eventOut SFSomethingElse ChildOneParam
...
url "javascript:do_something"
}
]
}

ROUTE Script.ChildOneParam TO ChildOne.set_Param
...
}

How can this be explained? I have no idea.

 


Script nodes inside Group affecting performance / Alexander Podshivalov / 10.08.10 07:50

Messages in thread: 1


© 1998-2009 ParallelGraphics. All rights reserved. Terms of use.