DefaultPointShader: control over sphere subdivision level

Something missing?
Post Reply
User avatar
gunn
Posts: 323
Joined: Thu 14. Dec 2006, 09:56
Location: TU Berlin
Contact:

DefaultPointShader: control over sphere subdivision level

Post by gunn » Thu 23. Aug 2012, 19:38

I've added a feature which has been suggested now and again: control over the quality of the spheres drawn by the DefaultPointShader in the JOGL backend.

You can now use Appearance attributes to control the fineness of the subdivision of the spheres rendered. For example to obtain medium quality spheres use:

Code: Select all

        SceneGraphComponent sgc = ...;
        sgc.getAppearance().setAttributes(CommonAttributes.LEVEL_OF_DETAIL, 0.5);
The maximum quality comes from a value of 1.0; the minimum from a value of 0.0 (the default).

Note that the attribute is not prefixed with CommonAttributes.POINT_SHADER -- it's considered a global parameter, and can be accessed through the RenderingHintsShader inspector of the Navigator panel.

CommonAttributes.LEVEL_OF_DETAIL has been around for a while in the jReality source but until now hasn't been used in the jReality core. In the unlikely case you have been using this attribute in your code, be advised that it now has the effect described above in the jReality core.

I've checked these changes into the jReality SVN repository.
jReality core developer

Post Reply