point sprite, source codes,dokumenty

 

[ Pobierz całość w formacie PDF ]
NameARB_point_spriteName StringsGL_ARB_point_spriteContactMatt Craighead, NVIDIA Corporation (mcraighead 'at' nvidia.com)Mark Kilgard, NVIDIA Corporation (mjk 'at' nvidia.com)Pat Brown, NVIDIA Corporation (pbrown 'at' nvidia.com)IP StatusNo known IP issues.StatusApproved by the ARB on July 24, 2003.VersionLast Modified Date: July 22, 2003Revision: 7NumberARB Extension #35DependenciesWritten based on the wording of the OpenGL 1.4 specification.NV_point_sprite affects the definition of this extension.OverviewApplications such as particle systems have tended to use OpenGL quadsrather than points to render their geometry, since they would liketo use a custom-drawn texture for each particle, rather than thetraditional OpenGL round antialiased points, and each fragment ina point has the same texture coordinates as every other fragment.Unfortunately, specifying the geometry for these quads can beexpensive, since it quadruples the amount of geometry required, andmay also require the application to do extra processing to computethe location of each vertex.The purpose of this extension is to allow such applications to usepoints rather than quads. When GL_POINT_SPRITE_ARB is enabled,the state of point antialiasing is ignored. For each texture unit,the app can then specify whether to replace the existing texturecoordinates with point sprite texture coordinates, which areinterpolated across the point.Issues* Should this spec say that point sprites get converted into quads?RESOLVED: No, this would make the spec much uglier, because thenwe'd have to say that polygon smooth and stipple get turned off,etc. Better to provide a formula for computing the texturecoordinates and leave them as points.* How are point sprite texture coordinates computed?RESOLVED: They move smoothly as the point moves around on thescreen, even though the pixels touched by the point do not. Theexact formula is given in the spec below.A point sprite can be thought of as a quad whose upper-left corner has(s,t) texture coordinates of (0,0) and whose lower-right corner hastexture coordinates of (1,1), as illustrated in the following figure.In the figure "P" is the center of the point sprite, and "O" is theorigin (0,0) of the window coordinate system. Note that the y windowcoordinate increases from bottom-to-top but the t texture coordinateof point sprites increases from top-to-bottom.^+y| (0,0)| +-----+| | || | P || | || +-----+| (1,1)| +xO--------------->Applications using a single texture for both point sprites and othergeometry need to account for the fixed coordinate mapping of pointsprites.* Is the ARB specification different from the NV version?RESOLVED: Yes. The point sprite R mode has been removed. Thewording has also been updated to reflect version 1.4 of the coreOpenGL specification however. The enumerant values are unchanged.* How do point sizes for point sprites work?RESOLVED: This specification treats point sprite sizes likeantialiased point sizes, but with more leniency. Implementationsmay choose to not clamp the point size to the antialiased pointsize range. The set of point sprite sizes available must bea superset of the antialiased point sizes. However, whereasantialiased point sizes are all evenly spaced by the point sizegranularity, point sprites can have an arbitrary set of sizes.This lets implementations use, e.g., floating-point sizes.* Should there be a way to query the list of supported point spritesizes?RESOLVED: No. If an implementation were to use, say, a single-precision IEEE float to represent point sizes, the list would berather long.* Do mipmaps apply to point sprites?RESOLVED: Yes. They are similar to quads in this respect.* What of this extension's state is per-texture unit and whatof this extension's state is state is global?RESOLVED: The GL_POINT_SPRITE_ARB enable is global. TheCOORD_REPLACE_ARB state is per-texture unit (state set by TexEnv isper-texture unit).* Should there be a global on/off switch for point sprites, orshould the per-unit enable imply that switch?RESOLVED: There is a global switch to turn it on and off. Thisis probably more convenient for both driver and app, and itsimplifies the spec.* What should the TexEnv mode for point sprites be called?RESOLVED: COORD_REPLACE_ARB.* What is the interaction with multisample points, which are round?RESOLVED: Point sprites are rasterized as squares, even inmultisample mode. Leaving them as round points would make thefeature useless.* How does the point sprite extension interact with fragmentprogram extensions (ARB_fragment_program, NV_fragment_program,etc)?RESOLVED: The primary issue is how the interpolated texturecoordinate set appears when fragment attribute variables(ARB terminology) or fragment program attribute registers (NVterminology) are accessed.When point sprite is enabled and the GL_COORD_REPLACE_ARB state fora given texture unit is GL_TRUE, the texture coordinate set forthat texture unit is (s,t,0,1) where the point sprite-overriddens and t are described in the amended Section 3.3 below. Theimportant point is that r and q are forced to 0 and 1, respectively.For fragment program extensions, r and q correspond to the z and wcomponents of the respective fragment attribute.* How does this extension interact with PolygonMode?RESOLVED: If a polygon is rendered in point mode and POINT_SPRITE_ARBis enabled, its vertices will be rendered as point sprites.* How does this extension interact with the point size attenuationfunctionality in ARB_point_parameters and OpenGL 1.4?RESOLVED: Point sprites sizes are attenuated just like the sizes ofnon-sprite points.* What push/pop attribute bits control the state of this extension?RESOLVED: POINT_BIT for all the state. Also ENABLE_BIT forthe POINT_SPRITE_ARB enable.* How are point sprites clipped?RESOLVED: Point sprites are transformed as points, and standard pointclipping operations are performed. This can cause point sprites thatmove off the edge of the screen to disappear abruptly, in the same waythat regular points do. As with any other primitive, standardper-fragment clipping operations (scissoring, window ownership test)still apply.New Procedures and FunctionsNoneNew TokensAccepted by the <cap> parameter of Enable, Disable, and IsEnabled, bythe <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, andGetDoublev, and by the <target> parameter of TexEnvi, TexEnviv,TexEnvf, TexEnvfv, GetTexEnviv, and GetTexEnvfv:POINT_SPRITE_ARB 0x8861When the <target> parameter of TexEnvf, TexEnvfv, TexEnvi, TexEnviv,GetTexEnvfv, or GetTexEnviv is POINT_SPRITE_ARB, then the value of<pname> may be:COORD_REPLACE_ARB 0x8862When the <target> and <pname> parameters of TexEnvf, TexEnvfv,TexEnvi, or TexEnviv are POINT_SPRITE_ARB and COORD_REPLACE_ARBrespectively, then the value of <param> or the value pointed to by<params> may be:FALSETRUEAdditions to Chapter 2 of the OpenGL 1.4 Specification (OpenGL Operation)None.Additions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization)Insert the following paragraphs after the second paragraph of section3.3 (page 66):"Point sprites are enabled or disabled by calling Enable or Disablewith the symbolic constant POINT_SPRITE_ARB. The default state is forpoint sprites to be disabled. When point sprites are enabled, thestate of the point antialiasing enable is ignored.The point sprite texture coordinate replacement mode is set with oneof the commandsvoid TexEnv{if}(enum target, enum pname, T param)void TexEnv{if}v(enum target, enum pname, const T *params)where target is POINT_SPRITE_ARB and pname is COORD_REPLACE_ARB. Thepossible values for param are FALSE and TRUE. The default value foreach texture unit is for point sprite texture coordinate replacementto be disabled."Replace the first two sentences of the second paragraph of section3.3.1 (page 67) with the following:"The effect of a point width other than 1.0 depends on the state ofpoint antialiasing and point sprites. If antialiasing and pointsprites are disabled, ..."Replace the first sentences of the fourth paragraph of section 3.3.1(page 68) with the following:"If antialiasing is enabled and point sprites are disabled, ..."Insert the following paragraphs at the end of section 3.3.1 (page70):"When point sprites are enabled, then point rasterization produces afr... [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • fotocafe.xlx.pl
  •