Fog simulation for partially transparent objects
First Claim
1. In a graphics rendering system for generating an output image from a 3D graphics scene having a viewpoint and graphical object models, a method for simulating fog in the 3D graphics scene, the method comprising:
- for a pixel having a color A and being rasterized for an object in the 3D graphics scene, computing an amount of fog ƒ
of color F between the viewpoint and the object, wherein A comprises color components and an opacity component;
applying the amount of fog ƒ
between the viewpoint and the object to the pixel using at least F and A in an atop image operator, wherein applying the amount of fog comprises the following (a)-(c) (a) multiplying each of the color and opacity components of the pixel by a factor (1−
ƒ
) to compute a first intermediate result, where ƒ
is a dissolve factor representing an amount of fog between the viewpoint in the scene and pixel depth of the pixel;
(b) multiplying color components of a fog color value F by the opacity component of the pixel, and by the dissolve factor ƒ
to compute a second intermediate result; and
(c) adding the first and second intermediate results to compute a fogged pixel; and
repeating the above for additional pixels rasterized for the object to compute an image simulating the object in fog.
2 Assignments
0 Petitions
Accused Products
Abstract
A method for simulating fog in 3D graphics rendering applications correctly computes fogged pixel colors even in graphics scenes where two surfaces overlap and the frontmost surface is partially transparent. The method computes the fog for each surface according to the following formula: ƒF atop A, where ƒ is the amount of fog, F is the color of the fog, and A is the color of the pixel being fogged. Each fogged surface can be rendered independently to a separate image layer, called a fogged image layer. The graphics rendering system can then simulate the motion of a fogged image layer by moving the fogged layer in an (x,y) plane without re-computing the fogged pixels, or by moving the fogged layer in the z-direction and independently re-computing the moving fogged layer with a new value for the amount of fog applied to the image layer. The method applies to scenes where there are several fogged layers and to scenes that simulate fire and glow with pixels that are totally transparent but have non-zero color values.
-
Citations
19 Claims
-
1. In a graphics rendering system for generating an output image from a 3D graphics scene having a viewpoint and graphical object models, a method for simulating fog in the 3D graphics scene, the method comprising:
-
for a pixel having a color A and being rasterized for an object in the 3D graphics scene, computing an amount of fog ƒ
of color F between the viewpoint and the object, wherein A comprises color components and an opacity component;
applying the amount of fog ƒ
between the viewpoint and the object to the pixel using at least F and A in an atop image operator, wherein applying the amount of fog comprises the following (a)-(c)(a) multiplying each of the color and opacity components of the pixel by a factor (1−
ƒ
) to compute a first intermediate result, where ƒ
is a dissolve factor representing an amount of fog between the viewpoint in the scene and pixel depth of the pixel;
(b) multiplying color components of a fog color value F by the opacity component of the pixel, and by the dissolve factor ƒ
to compute a second intermediate result; and
(c) adding the first and second intermediate results to compute a fogged pixel; and
repeating the above for additional pixels rasterized for the object to compute an image simulating the object in fog. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
where ƒ
is the amount of fog, F is fog color, and A is a color of the pixel being fogged.
-
-
5. The method of claim 1 including computing fogged image layers for objects in the graphics scene using an atop image operator to compute each of the fogged image layers;
- and
combining each of the fogged image layers into an output image using an over image operator to combine the fogged image layers.
- and
-
6. The method of claim 1 including independently computing fogged image layers for objects in the graphics scene;
- and approximating motion of a moving object in the scene in an (x,y) plane relative to a viewpoint of the scene by moving a fogged image layer representing the moving object in the (x,y) plane.
-
7. The method of claim 1 wherein the object is a glowing object, having pixels with zero alpha components and non-zero color components, and wherein fog is applied to the glowing object according to the following formula:
-
8. The method of claim 1 wherein at least two fogged pixels from different objects at a pixel location are combined according to the following formula, wherein the pixels have colors A and B:
-
9. The method of claim 8 wherein more than two pixels from different objects at a pixel location are fogged according to an expression (xF atop X) where X are color values of an object and x is an amount of fog from the viewpoint to pixel X;
- and wherein the fogged pixels are combined using the over operator.
-
10. A computer-readable medium having computer executable instructions for performing the method of claim 1.
-
11. In a graphics rendering system for generating an output image from a 3D graphics scene having a viewpoint and graphical object models, a method for simulating fog in the 3D graphics scene, the method comprising:
-
for a pixel having a color A and being rasterized for an object in the 3D graphics scene, computing an amount of fog ƒ
of color F between the viewpoint and the object, wherein A comprises an opacity component;
applying the amount of fog ƒ
between the viewpoint and the object to the pixel using at least F and A in an atop image operator;
repeating the above for additional pixels rasterized for the object to compute an image simulating the object in fog;
simulating motion of a moving object in the scene in a z-direction relative to the viewpoint of the scene by rendering the moving object, including fogging the pixels of the moving object with a new fog amount, to compute a fogged image layer representing the moving object; and
re-using a previously computed fogged image layer by compositing the fogged image layer representing the moving object with the previously computed fogged layer to compute an output image.
-
-
12. In a graphics rendering system for generating an output image from a 3D graphics scene, a fog simulator for applying fog of color F to a pixel comprising a color component A, wherein A comprises an opacity value, the fog simulator comprising:
-
an amount of fog calculator for calculating an amount of fog ƒ
between the viewpoint and an object; and
a fog applier using A, F and ƒ
in an atop image operator to apply the amount of fog ƒ
of color F to the pixel comprising a color A, wherein A comprises an opacity value;
wherein the atop image operator comprises;
a first multiplier for multiplying the amount of fog ƒ and
opacity of the pixel to compute ƒ
Aα
;
a second multiplier for multiplying ƒ
Aα
and a fog color F to compute ƒ
Aα
F;
a third multiplier for multiplying (1−
ƒ
) and pixel color A to compute (1−
ƒ
)A; and
an adder for adding the results of the second and third multipliers to compute a fogged pixel via the atop image operator. - View Dependent Claims (13, 14)
a rasterizer for computing pixel color, opacity and depth values for pixel locations in a view space from geometric primitives in the object, for computing the amount of fog ƒ
, and for communicating the pixel color and opacity values and the amount of fog ƒ
to the fog applier.
-
-
14. The fog simulator of claim 12 further including an over image operator in communication with the adder for compositing the fogged pixel computed by the adder via the atop image operator with a pixel generated from a different object.
-
15. A graphics rendering system including a fog mode for applying fog to objects rendered as pixels to simulate fog, the graphics rendering system comprising:
-
a rasterizer for computing pixel color, opacity and depth values for pixel locations in a view space from geometric primitives in the objects, and for computing an amount of fog ƒ
between a viewpoint and an object surface of one of the objects being rendered;
a fog applicator for applying the amount of fog of a predetermined color to rasterized pixels from the rasterizer using an atop image operator to yield a plurality of fogged pixels from different objects, wherein the fogged pixels are fogged using an atop image operator; and
a compositor for compositing the plurality of fogged pixels from different objects together to compute a composite pixel value, wherein the plurality of fogged pixels are fogged using an atop image operator;
whereinthe fog is of a color F;
rasterized pixels from the rasterizer each comprise color components A, the color components A each comprising an opacity component; and
the fog applicator is operable for applying the amount of fog of a predetermined color to rasterized pixels from the rasterizer by using at least the following (a)-(c) for a pixel being fogged;
(a) multiplying the color components A, including the opacity component, of the pixel being fogged by a factor (1−
ƒ
) to compute a first intermediate result, where ƒ
is a dissolve factor representing an amount of fog between the viewpoint in the scene and pixel depth of the pixel being fogged;
(b) multiplying color components of a fog color value F by the opacity component of the pixel being fogged, and by the dissolve factor ƒ
to compute a second intermediate result; and
(c) adding the first and second intermediate results to compute a fogged pixel, wherein the fogged pixel is a fogged version of the pixel being fogged. - View Dependent Claims (16)
wherein the compositor is operable to combine independently rendered fogged image layers to form an output image for display.
-
-
17. In a graphics rendering system for generating an output image from a 3D graphics scene having a viewpoint and graphical object models, a method for simulating fog in the 3D graphics scene, the method comprising:
-
for a pixel being fogged and rasterized for an object in the 3D graphics scene, wherein the pixel being fogged has color components and an opacity component, computing an amount of fog ƒ
of color F between the viewpoint and the object;
applying the amount of fog ƒ
between the viewpoint and the object to the pixel being fogged using an atop image operator by performing at least the following (a) (b) and (c);
(a) multiplying the color components and the opacity component of the pixel being fogged by a factor (1−
ƒ
) to compute a first intermediate result, where ƒ
is a dissolve factor representing an amount of fog between the viewpoint in the scene and pixel depth of the pixel being fogged;
(b) multiplying color components of a fog color value F by the opacity component of the pixel being fogged, and by the dissolve factor ƒ
to compute a second intermediate result; and
(c) adding the first and second intermediate results to compute a fogged pixel, wherein the fogged pixel is a fogged version of the pixel being fogged; and
repeating the above steps for additional pixels rasterized for the object to compute an image simulating the object in fog. - View Dependent Claims (18)
for a second pixel being fogged and rasterized for a second object in the 3D graphics scene, wherein the second pixel being fogged has color components and an opacity component, computing an amount of fog ƒ
of color F between the viewpoint and the second object, wherein the second object overlaps the first from the viewpoint;
applying the amount of fog ƒ
between the viewpoint and the second object to the second pixel being fogged using an atop image operator by performing at least (a) (b) and (c); and
combining the first fogged pixel and the second fogged pixel to compute a composite fogged pixel, wherein the composite fogged pixel is a fogged version of a pixel representing an overlap between the first object and the second object.
-
-
19. A computer-readable medium having computer executable instructions for performing the following in a graphics rendering system for generating an output image from a 3D graphics scene having a viewpoint and graphical object models to simulate fog in the 3D graphics scene:
-
for a pixel being fogged and rasterized for an object in the 3D graphics scene, wherein the pixel being fogged has color components and an opacity component, computing an amount of fog ƒ
of color F between the viewpoint and the object;
applying the amount of fog ƒ
between the viewpoint and the object to the pixel being fogged using an atop image operator by performing at least the following (a) (b) and (c);
(a) multiplying the color components and the opacity component of the pixel being fogged by a factor (1−
ƒ
) to compute a first intermediate result, where ƒ
is a dissolve factor representing an amount of fog between the viewpoint in the scene and pixel depth of the pixel being fogged;
(b) multiplying color components of a fog color value F by the opacity component of the pixel being fogged, and by the dissolve factor ƒ
to compute a second intermediate result; and
(c) adding the first and second intermediate results to compute a fogged pixel, wherein the fogged pixel is a fogged version of the pixel being fogged; and
repeating the above for additional pixels rasterized for the object to compute an image simulating the object in fog.
-
Specification