System and method for rendering a particle-based fluid surface
AssigneeNVIDIA Corporation
InventorsSimon Green, Miguel Sainz, Wladimir Van Der Laan
Life of this patent
Estimating the term…
Abstract
A method for rendering a particle-based fluid surface includes generating a depth image of a plurality of particles which form a fluid surface, and smoothing the depth image to generate a smoothed depth image. From the smoothed depth image, a smoothed surface position and a smoothed surface normal for each of a plurality of pixels included within the smoothed depth image is determined, and a shaded surface of the fluid is rendered as a function of the smoothed surface positions and the smoothed surface normals.
Claims21
A method for rendering an image of a fluid surface composed of a plurality of particles, the method comprising:
- (i) generating, by processor circuitry, a depth image of a plurality of particles forming a fluid surface, each particle i of the plurality of particles corresponding to a pixel of a plurality of pixels included in the depth image, wherein each particle is rendered as a screen-oriented quad;
- (ii) smoothing the depth image to generate a smoothed depth image;
- (iii) from the smoothed depth image, determining a smoothed surface position and a smoothed surface normal for each of the plurality of pixels included within the smoothed depth image;
- and
- (iv) rendering a shaded surface of the fluid as a function of the smoothed surface positions and the smoothed surface normals,
- wherein a fluid thickness value (T) for each pixel is computed according to the equation:
- T
-
- (
- x
- ,
- y
- )
- =
- ∑
- i
- =
- 0
- n
-
- d
-
- (
- x
- -
- x
- i
- σ
- i
- ,
- y
- -
- y
- i
- σ
- i
- )
- where d is a kernel function d(x,y)=√{square root over (1−x2−y2)} in which x and y vary between −1 and +1 over a two dimensional screen space position of the particle and (x,y) is a particle position, n is the number of particles the computation is summed over, where xi and yi defines the projected position of the particle, and where σi is a projected size of the particle.
A processor operable to render an image of a fluid surface composed of a plurality of particles, the processor comprising:
- (i) processor circuitry operable to generate a depth image of a plurality of particles forming a fluid surface, each particle i of the plurality of particles corresponding to a pixel of a plurality of pixels included in the depth image, wherein each particle is rendered as a screen-oriented quad;
- (ii) processor circuitry operable to smooth the depth image to generate a smoothed depth image;
- (iii) processor circuitry operable to determine, from the smoothed depth image, a smoothed surface position and a smoothed surface normal for each of the plurality of pixels included within the smoothed depth image;
- and
- (iv) processor circuitry operable to render a shaded surface of the fluid as a function of the smoothed surface positions and the smoothed surface normals,
- wherein a fluid thickness value (T) for each pixel is computed according to the equation:
- T
-
- (
- x
- ,
- y
- )
- =
- ∑
- i
- =
- 0
- n
-
- d
-
- (
- x
- -
- x
- i
- σ
- i
- ,
- y
- -
- y
- i
- σ
- i
- )
- where d is a kernel function d(x,y)=√{square root over (1−x2−y2)} in which x and y vary between −1 and +1 over a two dimensional screen space position of the particle and (x,y) is a particle position, n is the number of particles the computation is summed over, where xi and yi defines the projected position of the particle, and where σi is a projected size of the particle.
A computer program product, resident on a non-transitory computer readable medium, operable to store executable instructions for rendering an image of a fluid surface composed of a plurality of particles, the computer program product comprising:
- (i) instruction code to generate a depth image of a plurality of particles forming a fluid surface, each particle i of the plurality of particles corresponding to a pixel of a plurality of pixels included in the depth image, wherein each particle is rendered as a screen-oriented quad;
- (ii) instruction code to smooth the depth image to generate a smoothed depth image;
- (iii) instruction code to determine, from the smoothed depth image, a smoothed surface position and a smoothed surface normal for each of the plurality of pixels included within the smoothed depth image;
- and
- (iv) instruction code to render a shaded surface of the fluid as a function of the smoothed surface positions and the smoothed surface normals,
- wherein a fluid thickness value (T) for each pixel is computed according to the equation:
- T
-
- (
- x
- ,
- y
- )
- =
- ∑
- i
- =
- 0
- n
-
- d
-
- (
- x
- -
- x
- i
- σ
- i
- ,
- y
- -
- y
- i
- σ
- i
- )
- where d is a kernel function d(x,y)=√{square root over (1−x2−y2)} in which x and y vary between −1 and +1 over a two dimensional screen space position of the particle and (x,y) is a particle position, n is the number of particles the computation is summed over, where xi and yi defines the projected position of the particle, and where σi is a projected size of the particle.
Dependencies are inferred from the claim text.