Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actualray_intellect

Posted 20 March 2013 - 08:06 PM

Hi,

 

I am not sure if this is the correct place to post this because I working in OpenGL and CG to create a fluid solver based on the GPU Gems 3 chapter 

 

Real time Simulation and Rendering of 3D Fluids

 

The code I have at the moment is in CG, and is based on the Render To Volume example in the OpenGL 10 SDK by Nvidia. The example shows a simple solution to the wave equation so I thought it might be the correct place to start.

 

 I set point filtering in the C++ code, however I could not add the 0.5 to the texel coordinates because the fluid tended to diverge quickly in the direction of the corner of the box -I am not sure if CG needs to add the 0.5 to get the texel center.

 

Edit: I'm convinced its the texel center problem - I found a resource about CG that explains some stuff so I have removed the code for now, I'll repost the program if I can fix it.


#4ray_intellect

Posted 20 March 2013 - 08:04 PM

Hi,

 

I am not sure if this is the correct place to post this because I working in OpenGL and CG to create a fluid solver based on the GPU Gems 3 chapter 

 

Real time Simulation and Rendering of 3D Fluids

 

The code I have at the moment is in CG, and is based on the Render To Volume example in the OpenGL 10 SDK by Nvidia. The example shows a simple solution to the wave equation so I thought it might be the correct place to start.

 

 I set point filtering in the C++ code, however I could not add the 0.5 to the texel coordinates because the fluid tended to diverge quickly in the direction of the corner of the box -I am not sure if CG needs to add the 0.5 to get the texel center.

 

Edit: I'm convinced its the texel center problem - I found a resource about CG that explains "samplerRECT" so I have removed the code for now 


#3ray_intellect

Posted 20 March 2013 - 08:00 PM

Hi,

 

I am not sure if this is the correct place to post this because I working in OpenGL and CG to create a fluid solver based on the GPU Gems 3 chapter 

 

Real time Simulation and Rendering of 3D Fluids

 

I should add that I did not expect to see a transparent flowing liquid when I implemented these shaders. The code I have at the moment is in CG, and is based on the Render To Volume example in the OpenGL 10 SDK by Nvidia. The example shows a simple solution to the wave equation so I thought it might be the correct place to start.

 

 I set point filtering in the C++ code, however I could not add the 0.5 to the texel coordinates because the fluid tended to diverge quickly in the direction of the corner of the box -I am not sure if CG needs to add the 0.5 to get the texel center.

 

I also think the input might be wrong, I have rendered a sphere of normal vectors into the velocity volume and the advection appears to be working, however the pressure solver is not working and is much worse than the original simulation ...is this the math of the GPU gems article or a bug in the pressure solver ?.  There is also an artefact of some colour left over from the position of the splats, this is more visible if the thing is run in lower resolution - I think its caused by the advection step.

 

Any help would be appreciated, anyway heres the code (attached)

 

(note: I am going to spend a couple of weeks doing it properly in CPU code before I move back to the GPU anyway, however it would be great to get this version running properly)


#2ray_intellect

Posted 20 March 2013 - 05:28 PM

Hi,

 

I am not sure if this is the correct place to post this because I working in OpenGL and CG to create a fluid solver based on the GPU Gems 3 chapter 

 

Real time Simulation and Rendering of 3D Fluids

 

I should add that I did not expect to see a transparent flowing liquid when I implemented these shaders. The code I have at the moment is in CG, and is based on the Render To Volume example in the OpenGL 10 SDK by Nvidia. The example shows a simple solution to the wave equation so I thought it might be the correct place to start.

 

 I set point filtering in the C++ code, however I could not add the 0.5 to the texel coordinates because the fluid tended to diverge quickly in the direction of the corner of the box -I am not sure if CG needs to add the 0.5 to get the texel center.

 

I also think the input might be wrong, I have rendered a sphere of normal vectors into the velocity volume and the advection appears to be working, however the pressure solver is not working and is much worse than the original simulation ...is this the math of the GPU gems article or a bug in the pressure solver ?.  There is also an artefact of some colour left over from the position of the splats, this is more visible if the thing is run in lower resolution - I think its caused by the advection step.

 

Any help would be appreciated, anyway heres the code (attached)

 

(note: I am going to spend a couple of weeks doing it properly in CPU code before I move back to the GPU anyway, however it would be great to get this version running properly)


#1ray_intellect

Posted 20 March 2013 - 05:26 PM

Hi,

 

I am not sure if this is the correct place to post this because I working in OpenGL and CG to create a fluid solver based on the GPU Gems 3 chapter 

 

Real time Simulation and Rendering of 3D Fluids

 

I should add that I did not expect to see a transparent flowing liquid when I implemented these shaders. The code I have at the moment is in CG, and is based on the Render To Volume example in the OpenGL 10 SDK by Nvidia. The example shows a simple solution to the wave equation so I thought it might be the correct place to start.

 

 I set point filtering in the C++ code, however I could not add the 0.5 to the texel coordinates because the fluid tended to diverge quickly in the direction of the corner of the box -I am not sure if CG needs to add the 0.5 to get the texel center.

 

I also think the input might be wrong, I have rendered a sphere of normal vectors into the velocity volume and the advection appears to be working, however the pressure solver is not working and is much worse than the original simulation ...is this the math of the GPU gems article or a bug in the pressure solver ?.  There is also an artefact of some colour left over from the position of the splats, this is more visible if the thing is run in lower resolution - I think its caused by the advection step.

 

Any help would be appreciated, anyway heres the code

 

https://dl.dropbox.com/u/67640641/Copy%20of%20render_texture_3D.zip

 

(note: I am going to spend a couple of weeks doing it properly in CPU code before I move back to the GPU anyway, however it would be great to get this version running properly)


PARTNERS