1 / 5

Fog Blending

Fog Blending. Fog blends a fog color with each rasterized pixel fragment's posttexturing color using a blending factor f. Factor f is computed in one of three ways, depending on the fog mode, in the range 0<=f<=1.0. Let z be the distance in eye coordinates from the origin to the

Download Presentation

Fog Blending

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Fog Blending Fog blends a fog color with each rasterized pixel fragment's posttexturing color using a blending factor f. Factor f is computed in one of three ways, depending on the fog mode, in the range 0<=f<=1.0. Let z be the distance in eye coordinates from the origin to the fragment being fogged: Cr' = f * Cr + (1-f) * Cf Where: Cr is the rasterized pixel color Cf is the fog color

  2. Fog Blending Modes GL_LINEAR: f = (end - z) / (end - start) GL_EXP: f = e^-(density * z) GL_EXP2: f = e^-( (density * z)^2)

  3. Fog Blending Modes From: OpenGL Programming Guide

  4. Setting the Fog Parameters

  5. Fog Parameters GL_FOG_MODE Specifies the blend mode, and is one of the symbolic constants: GL_LINEAR, GL_EXP, GL_EXP2 GL_FOG_DENSITY Specifies the scalar value used for fog density in the blending equation GL_FOG_START Specifies the starting z value used in the linear blending equation GL_FOG_END Specifies the ending z value used in the linear blending equation GL_FOG_COLOR Four valued array specifying the fog color

More Related