Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 20 Jan 2011
Offline Last Active Jul 31 2015 01:26 AM

Topics I've Started

Cosine weighted mapping explanations

17 April 2015 - 03:52 AM



I'm currently working with some algorithmes that required sampling a sphere using various mapping distributions. I'm using a Hammersley sequence to do so, which gives me 2 values in the [0, 1] range, and then I use those values to convert to a spherical coordinate, and finally convert to a cartesian coordinate. My source is this page : http://holger.dammertz.org/stuff/notes_HammersleyOnHemisphere.html

Now what I'm having trouble with is the mapping from the hammersley values to spherical. In the linked page, there are 2 mappings : uniform and cosinus. I perfectly understand the math behind the uniform mapping (e.g. I can find the equation to go from hammersley to cartesian on a piece of paper) but I'm totally lost when I look at the cosine weighted mapping.

I can't understand the signification of the square root, and where does it come from. And I can't find any explanation on the web has to how to obtain this equation. I kind of understand the principle of the cosine weighted mapping, but I can't take a piece of paper and write the equations to go from hammersley to the final cartesian coordinate using this mapping.


Is there anyone here that knows where does this square root comes from and cares explaning it to me ?


Thanks in advance for any help !

Level of details for particle systems

04 January 2012 - 10:58 AM


I'm currently doing a little bit of research to add level of details to our particle system. There doesn't seem to be much papers/articles on the subjects, so I thought I could ask in case someone have interesting ideas on the subject :)

Here is what I thought of so far :

We have a good animation system which I can use in the following way : the key time will be the emitter's distance to the camera, mapped to the [0, 1] range, and the value will be in the range [0, 1]. So, for any particle's parameter that I want to be "lodable", I can just let the artists create a curve to have precise control on how the parameters vary depending on the distance.

For the moment, the only relevant parameters that I thought could be "lodable" are the particles' birth rate (will make the number/density of particles decrease) and the particles' size (as the number of particle decrease, we might want to slightly increase the size to get a good visual result. I can't think of any other parameters that could be tweaked depending on the distance ... is there an obvious one I'm missing ?

And the second part is the materials. I thought of providing a list of materials, and depending on the position of particle at spawn time, assign the correct material (I don't want to switch material during a particle's lifetime, that would probably produce some glitches) That would allow to use cheaper shaders, smaller textures as the emitter goes farther from the camera.

What do you think ? Any other idea to improve a particle system base on distance ?

Thanks in advance for any help, and HAPPY NEW YEAR :)

void * to int and vice versa

30 June 2011 - 08:17 PM


I'm in the process of porting a little project of mine from MS only to MacOSX/MS, and I'm wondering how can I safely convert a void * to an int and vice versa on MacOSX ?
On Windows I simply used the PtrToInt() function provided, and am looking for a safe / clean way of doing this on MacOSX.

Thx in advance ^^

PS: I've quickly googled, and will continue, but I didn't find anything so far (my "google fu" might not be the best ^^)

Visual Studio always returning "up-to-date"

18 April 2011 - 03:55 PM

Hi there,

I don't know if this forum is the best for this Miscrosoft Visual Studio sepcific question, but it's the best I know, so here it is :

We have a really simple library project (less than 20 files) that recently started to always fail silently when compiled from the the command line. This is a really strange problem : when I compile from the IDE, it works fine, but as soon as I want to build using the command lines, the only thing which happens is that it creates the output directories, and the BuildLog.htm. And this log only contains "up-to-date".

We tried re-creating the project from scratch, leaving everything to default settings, only adding the .cpp / .h files, and setting "build as library", but the problem remains the same. We tried to move the whole project around on another harddrive, we double checked the files' times, everything seems normal. The problem seems to happen with vcbuild, since we tried to directly launch vcbuild on the .vcproj file, and the problem is still here.

From these observations, I thought that maybe a few files were corrupted, but we also checked that and it doesn't seem to be the case. Also, the problem happens only on one machine. On all the others, the project compiles without trouble, in command line and in the IDE. AND on the machine where it fails, other projects compile perfectly fine !!

So I (and a few collegues) am completely lost ... Anyone here having ever heard of such bug / behavior ? Any idea of things I might check ? Don't hesitate any advice, things I might look at, check, etc. !! Even the strangest ones, we HAVE to make this project build on this machine (it worked fine a few days ago, and except from updating a PS3 SDK, we didn't change anything)

Thanks in advance !