Peer-to-Peer Forum

 

Login Register    
Culling distance
Posted: 13 August 2010 01:37 AM  
Newbie
Rank
Total Posts:  14
Joined  2010-06-01

Hello,
I have some issues concerning culling mech.
First:
I would like to arrange culling range of some elements independently. For example , want cloud layer culling distance to be 20000 while channel far plane is 3000.

Second:
I have coded cars moving automaticly with a given path. But i want to update auto car positions only when they are in my draw area (Meaning they are not culled out.). I subscribed my auto vehicles for culling but here comes the problem:

1- I want cars to be culled (In order to update their positions) with a far plane 3000 meters

2- I want my all other scene environment to be culled with a far plane 20000.

Is there a way to do any of these? I m not familiar with cull factory or etc but i have took a look at them.
Can you supply codes or examples if any ?

thanks

 
Posted: 17 August 2010 07:33 AM   [ # 1 ]  
Member
RankRankRank
Total Posts:  78
Joined  2007-07-23

This is what I would do ... I would set my far clip to 200000.  Add a EVEVT_PRE_CULL subscriber to the channel.  From the subscriber you can determine your distance to each object.  THen you can prune at your leasure.  See vpChannel::addSubscriber() ... EVENT_PRE_CULL. vsChannel::notify() and vsTraversalCull()

chas

 
Posted: 17 August 2010 07:38 AM   [ # 2 ]  
Newbie
Rank
Total Posts:  14
Joined  2010-06-01

thanks for the reply.

Is there a way to prevent cloudlayer to be culled out? For ex we have FOV a 3000m at far side. But i dont want to have my cloud layer to be prunned in that distance.

How can this be achieved?

 
Posted: 18 August 2010 03:45 AM   [ # 3 ]  
Jr. Member
RankRank
Total Posts:  33
Joined  2009-04-03

You can stop scene elements from being culled by the far clipping plane, by altering its depth test
It may be possible to use the same mechanism to alter your clouds

  vrDepthTest::Element* pDepthTest = new vrDepthTest::Element();
  pDepthTest->m_mode = vrDepthTest::MODE_LESS;
  pDepthTest->m_enable = true;

  vpEnvSkyDome* skyDome = vpEnvSkyDome::find(“myEnvSkyDome”);
  skyDome->getState(0)->setElement(pDepthTest->getIdBase(), pDepthTest);
  skyDome->getState(1)->setElement(pDepthTest->getIdBase(), pDepthTest);

you may need to try some other modes to get your desired behaviour

 
Posted: 01 September 2010 02:01 AM   [ # 4 ]  
Newbie
Rank
Total Posts:  14
Joined  2010-06-01

Thank you i wwill try them now.

Unfortunately it didnt work. Or i couldnt make it in the right way. Any one has tried it ?