Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3508 Members - Latest Member: NevilleKemp

26. May 2012, 07:12:23 pm
Xith3D CommunityGeneral CategoryFeature Requests & Brilliant Ideas (Moderators: Marvin Fröhlich, 'n ddrylliog)Conditional Switch
Pages: 1 [2]
Print
Author Topic: Conditional Switch  (Read 4741 times)
Patheros
Getting respectable
***
Offline Offline

Posts: 267


Dead Dolphin


View Profile WWW Email
« Reply #15 on: 25. February 2007, 11:02:56 pm »

I don't think so. The nearer the far clipping plane, the better is depth buffer precision. But I will test the performance impact of that.

I await your results.

Can't you achieve your goal by using an additional render pass?  You could draw the planet in its own (probably display list?) scenegraph rendered behind the primary scene graph with the short clipping distance you desire.

I've thought about that. I've hardly done anything with render passes so far. I probably will look into it before I start implementing anything.
Logged

"I like my method, what was my method again?" - Jon
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #16 on: 25. February 2007, 11:07:42 pm »

I've thought about that. I've hardly done anything with render passes so far. I probably will look into it before I start implementing anything.

Easy:
Code:
BranchGroup farScene = createFarScene();
BranchGroup nearScene = createNearScene();

RenderPass farPass = RenderPass.createPerspective( farScene );
farPass.getConfig().setFrontClipDistance( 4000.0f );
farPass.getConfig().setBackClipDistance( 5000.0f );

RenderPass nearPass = RenderPass.createPerspective( nearScene );
nearPass.getConfig().setFrontClipDistance( 1.0f );
nearPass.getConfig().setBackClipDistance( 500.0f );

env.addRenderPass( farPass );
env.addRenderPass( nearPass );

This should basically work.

Marvin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #17 on: 25. February 2007, 11:26:51 pm »

I don't think so. The nearer the far clipping plane, the better is depth buffer precision. But I will test the performance impact of that.

I await your results.

I used the Q3FlightTest, where the near clip plane currently is at 1.0 and the far plane at 2000. I checked, the maximum distance of shapes during a flight, which was at about 40 and therefore set the far clip plane to 100. The FPS were about the same. So I guess, it makes no difference in performance concerns.

Marvin
Logged
Patheros
Getting respectable
***
Offline Offline

Posts: 267


Dead Dolphin


View Profile WWW Email
« Reply #18 on: 25. February 2007, 11:38:51 pm »

Thanks for the code and the test results Marvin. I will definitely try to use them as soon get around to it.
Logged

"I like my method, what was my method again?" - Jon
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #19 on: 01. March 2007, 02:46:47 am »

I've added the LODSwitch Node. Please have a look at org.xith3d.test.scenegraph.LODSwitchTest. And please tell me, if it serves your needs.

Marvin
Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #20 on: 01. March 2007, 08:59:25 am »

I've added the LODSwitch Node. Please have a look at org.xith3d.test.scenegraph.LODSwitchTest. And please tell me, if it serves your needs.
It needs several Shape3Ds or does it make the "downsampling" itself ?
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #21 on: 01. March 2007, 10:46:22 am »

It needs several Shape3Ds or does it make the "downsampling" itself ?

It is discrete LOD. So it needs several Nodes (could be whole Models).

Creating a continuous LOD calculator there's much more to do. Much more complicated math. But maybe it's already done in one of the model loaders. I don't remember which, but I think I saw something about LOD in one of them (I think it was Cal3D). Maybe the LOD is coming from the Model format. But if not, I could try to generalize the LOD code.

Marvin
Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #22 on: 01. March 2007, 07:57:16 pm »

It needs several Shape3Ds or does it make the "downsampling" itself ?

It is discrete LOD. So it needs several Nodes (could be whole Models).

Creating a continuous LOD calculator there's much more to do. Much more complicated math. But maybe it's already done in one of the model loaders. I don't remember which, but I think I saw something about LOD in one of them (I think it was Cal3D). Maybe the LOD is coming from the Model format. But if not, I could try to generalize the LOD code.
My opinion :
- Generalizing the Cal3D code will be hard
- Continuous LOD isn't really used those days, discrete LOD is preferred, so it's not an important feature..
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #23 on: 01. March 2007, 08:01:49 pm »

My opinion :
- Generalizing the Cal3D code will be hard
- Continuous LOD isn't really used those days, discrete LOD is preferred, so it's not an important feature..

OK, agreed.
Logged
Patheros
Getting respectable
***
Offline Offline

Posts: 267


Dead Dolphin


View Profile WWW Email
« Reply #24 on: 01. March 2007, 08:20:50 pm »

- Continuous LOD isn't really used those days, discrete LOD is preferred, so it's not an important feature..

Isn't there a Morph node that might be suitable for continuous LOD if someone wanted it?
Logged

"I like my method, what was my method again?" - Jon
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #25 on: 01. March 2007, 08:26:47 pm »

Isn't there a Morph node that might be suitable for continuous LOD if someone wanted it?
Yeah but IIRC, the Morph node works only with geometries having the same vertice count.
Logged
Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic