E D R S I H C RSS
ID
Password
Join
부자가 되는 지름길은, 값이 싸고 습관적으로 쓸 수 있는 데다가 세금이 공제될 수 있는 물건을 만들어 내는 것. ―「선샤인 매거진」

개요 #

이 확장의 내용은 정점(point)들에 대해서 추가적인 기하학 특성을 지원한다. 이것은 파티클이나 광원이 위치하고 있는 곳을 나타내는 작은 정점들을 랜더링할때 사용될 수 있다.

The raster brightness of a point is a function of the point area, point color, point transparency, and the response of the display's electron gun and phosphor.

정점 영역과 정점 투명도는 포인트 크기에 따라 정해진다. (정점 크기는 glPointSize() 함수로 지정된다)

이 확장의 주된 제작 동기는 포인트의 크기가 거리 감쇠(거리가 멀어질수록 희미하게 보인다거나 하는 현상)에 의해 영향받도록 하는 것이다. 이렇게 된다면, 시점으로부터 정점까지의 거리가 증가할수록 최종 정점의 크기는 감소된다.

The secondary motivation is a mean to control the mapping from the point size to the raster point area and point transparency. 두번째 제작 동기는 정점 크기로부터 화면에 찍히는 최종 정점의 영역과 정점 투명도를 매핑하는 것을 조정하는 방법이 필요해서이다.

This is done in order to increase the dynamic range of the raster brightness of points. In other words, the alpha component of a point may be decreased (and its transparency increased) as its area shrinks below a defined threshold.

이 확장은 상속된 정점 크기를 정점의 밝기에 아주 밀접하게 관련되도록 정의한다. 정점의 밝기는 다음에 의해 정의된다.

dist_atten(d) = 1 / (a + b * d + c * d^2)
brightness(Pe) = Brightness * dist_atten(|Pe|)

where 'Pe' is the point in eye coordinates, and 'Brightness' is some initial value proportional to the square of the size provided with glPointSize. Here we simplify the raster brightness to be a function of the rasterized point area and point transparency.

	            brightness(Pe)			brightness(Pe) >= Threshold_Area
	area(Pe) =
                    Threshold_Area			Otherwise

	factor(Pe) = brightness(Pe)/Threshold_Area

	alpha(Pe) = Alpha * factor(Pe)

where 'Alpha' comes with the point color (possibly modified by lighting).

'Threshold_Area' above is in area units. Thus, it is proportional to the square of the threshold provided by the programmer through this extension.

The new point size derivation method applies to all points, while the threshold applies to multisample points only.

문답들 #

  • 정점의 알파값 수정이 현재 색상에 영향을 미치는가? - 아니다.
  • glGetPointParameterfvEXT()라든가 glGetFloat() 함수를 사용할 필요가 있는가? - 아니다.
  • 만약 알파값이 0이면, 우리는 fragment 단계에 도달하기전에 정점을 튕길수 있을까? - 안된다. 이것은 glAlphaTest(GL_LEQUAL, 0)으로 지정함으로써 같은 효과를 낼 수 있다.
  • Do we need a disable for applying the threshold ? The default threshold value is 1.0. It is applied even if the point size is constant. - If the default threshold is not overriden, the area of multisample points with provided constant size of less than 1.0, is mapped to 1.0, while the alpha component is modulated accordingly, to compensate for the larger area. For multisample points this is not a problem, as there are no relevant applications yet. As mentioned above, the threshold does not apply to alias or antialias points.

The alternative is to have a disable of threshold application, and state that threshold (if not disabled) applies to non antialias points only (that is, alias and multisample points).

The behavior without an enable/disable looks fine.

확장에 따른 함수들 #

void glPointParameterfEXT ( GLenum pname, GLfloat param );
void glPointParameterfvEXT ( GLenum pname, GLfloat *params );

새로운 상수들 #

glPointParameterfEXT(), glGet()의 pname인자로 사용될 추가값은 다음과 같다.
GL_POINT_SIZE_MIN_EXT              0x8126
GL_POINT_SIZE_MAX_EXT              0x8127
GL_POINT_FADE_THRESHOLD_SIZE_EXT   0x8128
GL_DISTANCE_ATTENUATION_EXT        0x8129

Additions to Chapter 3 of the 1.0 Specification (Rasterization) #

All parameters of the glPointParameterfEXT and glPointParameterfvEXT functions set various values applied to point rendering. The derived point size is defined to be the <size> provided with glPointSize modulated with a distance attenuation factor.

The parameters GL_POINT_SIZE_MIN_EXT and GL_POINT_SIZE_MAX_EXT simply define an upper and lower bounds respectively on the derived point size.

The above parameters affect non multisample points as well as multisample points, while the GL_POINT_FADE_THRESHOLD_SIZE_EXT parameter, has no effect on non multisample points. If the derived point size is larger than the threshold size defined by the GL_POINT_FADE_THRESHOLD_SIZE_EXT parameter, the derived point size is used as the diameter of the rasterized point, and the alpha component is intact. Otherwise, the threshold size is set to be the diameter of the rasterized point, while the alpha component is modulated accordingly, to compensate for the larger area.

The distance attenuation function coefficients, namely a, b, and c in:
dist_atten(d) = 1 / (a + b * d + c * d^2)
are defined by the <pname> parameter GL_DISTANCE_ATTENUATION_EXT of the function glPointParameterfvEXT. By default a = 1, b = 0, and c = 0.

Let 'size' be the point size provided with glPointSize, let 'dist' be the distance of the point from the eye, and let 'threshold' be the threshold size defined by the GL_POINT_FADE_THRESHOLD_SIZE parameter of glPointParameterfEXT. The derived point size is given by:
derived_size = size * sqrt(dist_atten(dist))

Note that when default values are used, the above formula reduces to:
derived_size = size
the diameter of the rasterized point is given by:
	           derived_size			derived_size >= threshold
	diameter = 
	           threshold			Otherwise
The alpha of a point is calculated to allow the fading of points instead of shrinking them past a defined threshold size. The alpha component of the rasterized point is given by:
                 1                              derived_size >= threshold
	alpha *=
                 (derived_size/threshold)^2     Otherwise
The threshold defined by GL_POINT_FADE_THRESHOLD_SIZE_EXT is not clamped to the minimum and maximum point sizes.

Points do not affect the current color.

This extension doesn't change the feedback or selection behavior of points.

에러값 #

  • INVALID_ENUM가 반환되는 경우
    • PointParameterfEXT() 함수 사용시 pname인자에 GL_POINT_SIZE_MIN_EXT, GL_POINT_SIZE_MAX_EXT, GL_POINT_FADE_THRESHOLD_SIZE_EXT이 아닌 값을 적용했을 경우.
    • PointParameterfvEXT 함수 사용시 pname인자에 GL_POINT_SIZE_MIN_EXT, GL_POINT_SIZE_MAX_EXT, GL_POINT_FADE_THRESHOLD_SIZE_EXT, GL_DISTANCE_ATTENUATION_EXT 아닌 값을 적용했을 경우.
  • INVALID_VALUE가 반환되는 경우
    • 입력값에 0 미만의 수 (음수)를 넣었을 경우.

New State #

Get 값 Get 명령 데이타 타입 초기치 속성
GL_POINT_SIZE_MIN_EXT GetFloatv float 0 point
GL_POINT_SIZE_MAX_EXT GetFloatv float M point
GL_POINT_FADE_THRESHOLD_SIZE_EXT GetFloatv float 1 point
GL_DISTANCE_ATTENUATION_EXT GetFloatv 3 x float (1,0,0) point

  • M 은 정점 크기의 최대값이다.


Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2010-10-28 12:42:52
Processing time 0.3410 sec