Object3d switching/swapping in renderhook.

Started by lawless_c, November 21, 2014, 06:32:03 PM

Previous topic - Next topic

lawless_c

Is there a standard way for quickly swapping out objects?

I'm thinking of making an addition to my game so that objects get swapped for very simple billboards at large distances.

If i can i get two benefits:

incredible distant objects can be made easily selectable.

Rendering very large quantities of objects will have less of an impact of rendering speed(I'm not really worried by this though as it hasn't been an issue so far).

EgonOlsen

There's no way use a renderhook for this. That's would be like selling your car while you are sitting inside of it. If you want to do that, just iterate through your objects and switch them. You might want to use some MVC approach for this, so that your actual object is decoubled from the view (complex or billboard). If that's not feasible, you might try to add the billboard as a child of the complex object and switch visibility of those two based on distance to the player.

lawless_c

I could try the visibility/switching trick.

If an objects visibility is set to completely transparent though will JPCT still go through all the calculations of trying to render the objects mesh?


EgonOlsen

Yes, of course. What comes out of a transparent object depends on the shader. There's no way to tell that it will by really invisible.

lawless_c

hmm ok, i'll iterating though at switching the references istead.