Different frustrum inside one rendering step

Hi All!

How to render objects like this. My two type of objects are

  1. objects, that I want to see far from my viewpoint.
  2. objects, that I want to see only near from my viewpoint.



    I thought, that frustrum culling will be the solution, BUT, if I change the camera.setFrustrum, ZBuffer will be chaotic.

    Then I used fog effext, but it is not the solution, the rendering is happening which I don't need, not optimal.

    There is clipping state, but if I change the camera position, I need to change the clipping plane. Not optimal.



    Is there any solution?

    Thanks

I have a custom Node subclass for type 2 objects. In it's onDraw() method it checks it's square distance to display.getRenderer().getCamera()'s location and just returns if that is greater than a specified threshold value. Would that work for you?

Thank YOU!!!

  • Is it enough to overwrite only the onDraw method (and add my special feature)? Is there something important to know about it?
  • How can I get the bounding volume of a node? ()
  • How can I get the distance of a bounding volume from a location?



    (sorry for newbie questions…)
fugedi.zsolt said:

- Is it enough to overwrite only the onDraw method (and add my special feature)? Is there something important to know about it?

As I said, for me it works exactly like that. If there are any major pitfalls to that method, they have slipped my mind.

fugedi.zsolt said:

- How can I get the bounding volume of a node? ()

Node.getWorldBound()

fugedi.zsolt said:

- How can I get the distance of a bounding volume from a location?

I think you'd have to compute that yourself. In my approach I describe above, I don't care for bounding volumes of faraway (type 2) objects, i just use their model origin coordinates for distance calculation.

For in-depth information about any of the above and beyond try the tutorials and guides on the wiki, and have a look at the classes in jmetest - about every feature of jME is documented in at least one simple test class there. jME's javadoc is also very up to date and quite comprehensive.