Ignore:
Timestamp:
12/12/06 17:25:53 (18 years ago)
Author:
bittner
Message:

mixture distribution initial coding

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp

    r1877 r1883  
    2828#include "Preprocessor.h" 
    2929#include "SceneGraph.h" 
     30#include "SamplingStrategy.h" 
    3031 
    3132 
     
    19491950                Vector3 direction = VssRay::GetDirection(dirVector.x, dirVector.y); 
    19501951                //cout<<"dir vector.x="<<dirVector.x<<"direction'.x="<<atan2(direction.x, direction.y)<<endl; 
    1951                 rays.push_back(SimpleRay(origin, direction)); 
     1952                rays.push_back(SimpleRay(origin, 
     1953                                                                 direction, 
     1954                                                                 SamplingStrategy::RSS_BASED_DISTRIBUTION, 
     1955                                                                 1.0f 
     1956                                                                 )); 
    19521957          } 
    19531958        } else { 
     
    23082313 
    23092314  //Debug<<"dir vector.x="<<dirVector.x<<"direction'.x="<<atan2(direction.x, direction.y)<<endl; 
    2310   rays.push_back(SimpleRay(origin, direction)); 
     2315  rays.push_back(SimpleRay(origin, 
     2316                                                   direction, 
     2317                                                   SamplingStrategy::RSS_BASED_DISTRIBUTION, 
     2318                                                   1.0f 
     2319                                                   )); 
    23112320} 
    23122321 
     
    24722481        if (!intersects) { 
    24732482          //cout<<"dir vector.x="<<dirVector.x<<"direction'.x="<<atan2(direction.x, direction.y)<<endl; 
    2474           rays.push_back(SimpleRay(origin, direction)); 
     2483          rays.push_back(SimpleRay(origin, 
     2484                                                           direction, 
     2485                                                           SamplingStrategy::RSS_BASED_DISTRIBUTION, 
     2486                                                           1.0f 
     2487                                                           )); 
    24752488          generated++; 
    24762489        } 
     
    25882601        if (node->IsLeaf()) { 
    25892602          RssTreeLeaf *leaf = (RssTreeLeaf *)node; 
    2590           prunned += PruneRaysRandom(leaf, ratio); 
    2591           //prunned += PruneRaysContribution(leaf, ratio); 
     2603          //prunned += PruneRaysRandom(leaf, ratio); 
     2604          prunned += PruneRaysContribution(leaf, ratio); 
    25922605        } else { 
    25932606          RssTreeInterior *in = (RssTreeInterior *)node; 
     
    27222735// if small very high importance of the last sample 
    27232736// if 1.0f then weighs = 1 1/2 1/3 1/4 
    2724 //float passSampleWeightDecay = 1.0f; 
    2725 float passSampleWeightDecay = 1000.0f; 
     2737float passSampleWeightDecay = 1.0f; 
     2738//float passSampleWeightDecay = 1000.0f; 
    27262739 
    27272740float 
     
    27302743  int passDiff = mCurrentPass - pass; 
    27312744  float weight; 
    2732   if (1)  
     2745  if (0)  
    27332746        weight = 1.0f/(passDiff + passSampleWeightDecay); 
    27342747  else  
     
    27772790RssTree::ComputeImportance(RssTreeLeaf *leaf)  
    27782791{ 
     2792#if 1 
    27792793  if (leaf->mTotalRays) 
    27802794        leaf->mImportance = leaf->mTotalContribution / leaf->mTotalRays; 
    27812795  else 
    2782         leaf->mImportance = 0.0f; 
     2796        leaf->mImportance = Limits::Small; 
    27832797  return; 
     2798#endif 
    27842799   
    27852800  if (0)  
Note: See TracChangeset for help on using the changeset viewer.