Guest User

Untitled

a guest
Jun 24th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. float trafo(float n, float x)
  2. {
  3.     return -log(-n*(1-exp(-x))+1);
  4. }
  5.  
  6. void SmokeRenderer::massCorrection( cell_list * cell_list, density_pic * density_pic )
  7. {  
  8.     cudaMemcpy(alpha,&g_particleEngine->data().alpha->at(0),sizeof(float)*mNumParticles,cudaMemcpyDeviceToHost);
  9.     cudaMemcpy(radius,&g_particleEngine->data().radius->at(0),sizeof(float)*mNumParticles,cudaMemcpyDeviceToHost);
  10.  
  11.     //exp transform based on direct vol rendering eqtn
  12.     for (int i = 0; i < mNumParticles; i++)
  13.     {
  14.         float n = alpha[i]/0.1;
  15.         alpha[i] = trafo(n,alpha[i]);
  16.     }
Add Comment
Please, Sign In to add comment