15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci SGIS_fog_function 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_SGIS_fog_function 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciVersion 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Last Modified Date: March 30, 1999 125bd8deadSopenharmony_ci Author Revision: $Header: //depot/main/doc/registry/extensions/SGI/fog_func.spec#13 $ 135bd8deadSopenharmony_ci 145bd8deadSopenharmony_ciNumber 155bd8deadSopenharmony_ci 165bd8deadSopenharmony_ci 64 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciDependencies 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci OpenGL 1.1 is required. Written against the OpenGL 1.2 Specification. 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciOverview 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci This extension allows to define application-specific fog blend-factor 255bd8deadSopenharmony_ci function. Function is defined by the set of the "control" points and 265bd8deadSopenharmony_ci should be monotonic. Each control point represented as a pair of the 275bd8deadSopenharmony_ci eye-space distance value and corresponding value of the fog blending 285bd8deadSopenharmony_ci factor. The minimum number of control points is one. The maximum 295bd8deadSopenharmony_ci number is implementation dependent. 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciNew Procedures and Functions 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci void FogFuncSGIS(sizei n, const float* points); 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ci void GetFogFuncSGIS(float *points); 375bd8deadSopenharmony_ci 385bd8deadSopenharmony_ciIssues 395bd8deadSopenharmony_ci 405bd8deadSopenharmony_ci - The Bali team introduced 2 new features in this spec. 1) the 415bd8deadSopenharmony_ci GetFogFuncSGIS procedure that allows to querry automatically 425bd8deadSopenharmony_ci the current number of contol points. It is much nicer than 435bd8deadSopenharmony_ci the previous spec that was using gets. 2) If the user give 445bd8deadSopenharmony_ci fog blending factor ouside the [0.0, 1.0] range it should not 455bd8deadSopenharmony_ci generate an error but the valuse should be calmed instead. 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ci However, this extension has already been shipped and it is a 485bd8deadSopenharmony_ci problem. We would like to see this extension to be an EXT to 495bd8deadSopenharmony_ci be able to do the right thing. 505bd8deadSopenharmony_ci 515bd8deadSopenharmony_ci - If the above changes are not acceptable, the sentence "All the points 525bd8deadSopenharmony_ci of the current fog factor function are queried by calling 535bd8deadSopenharmony_ci GetFogFuncSGIS." in section "Additions to Chapter 6 of the 1.2 545bd8deadSopenharmony_ci Specification (State and State Requests)" should be replaced by: 555bd8deadSopenharmony_ci "All the points of the current fog factor function are queried by 565bd8deadSopenharmony_ci calling GetFloatv or GetDoublev with <pname> set to FOG_FUNC_SGIS." 575bd8deadSopenharmony_ci Also, the sentence "INVALID_OPERATION is generated if GetFogFuncSGIS 585bd8deadSopenharmony_ci is executed between execution of Begin and the corresponding 595bd8deadSopenharmony_ci execution to End. " in the "Errors" section should be ignored. 605bd8deadSopenharmony_ci 615bd8deadSopenharmony_ci The sentences "The first value of each value pair in <points> 625bd8deadSopenharmony_ci specifies a value of eye-space distance (should be not negative), 635bd8deadSopenharmony_ci and the second value of each value pair specifies the corresponding 645bd8deadSopenharmony_ci value of the fog blend factor. The fog blend factor values are 655bd8deadSopenharmony_ci clamped to [0.0, 1.0]." should be replced by "The first 665bd8deadSopenharmony_ci value of each value pair in <points> specifies a value of eye-space 675bd8deadSopenharmony_ci distance (should be not negative), and the second value of each value pair 685bd8deadSopenharmony_ci specifies the corresponding value of the fog blend factor (should be in 695bd8deadSopenharmony_ci [0.0, 1.0] range)." Also "INVALID_VALUE is generated if fog factor 705bd8deadSopenharmony_ci value out of [0.0, 1.0] range." should be added to the error section. 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ci 735bd8deadSopenharmony_ciNew Tokens 745bd8deadSopenharmony_ci 755bd8deadSopenharmony_ci Accepted by the <param> parameter of Fogf and Fogi, and by the <params> 765bd8deadSopenharmony_ci parameter of Fogiv and Fogfv, when their <pname> parameter is FOG_MODE, 775bd8deadSopenharmony_ci and by the <pname> parameter of GetDoublev and GetFloatv: 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ci FOG_FUNC_SGIS = 0x812A 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetBooleanv, GetDoublev, 825bd8deadSopenharmony_ci GetIntegerv, and GetFloatv: 835bd8deadSopenharmony_ci 845bd8deadSopenharmony_ci FOG_FUNC_POINTS_SGIS = 0x812B 855bd8deadSopenharmony_ci MAX_FOG_FUNC_POINTS_SGIS = 0x812C 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci May be returned by GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv 885bd8deadSopenharmony_ci when their <pname> parameter is FOG_MODE: 895bd8deadSopenharmony_ci 905bd8deadSopenharmony_ci FOG_FUNC_SGIS = 0x812A 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.2 Specification (OpenGL Operation) 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci None 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.2 Specification (Rasterization) 985bd8deadSopenharmony_ci 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci 3.10 Fog 1015bd8deadSopenharmony_ci 1025bd8deadSopenharmony_ci The function for computing blending factor may be specified by calling 1035bd8deadSopenharmony_ci FogFuncSGIS with <points> pointing at an array of pairs of floating point 1045bd8deadSopenharmony_ci values, and <n> set to the number of value pairs in <points>. The first 1055bd8deadSopenharmony_ci value of each value pair in <points> specifies a value of eye-space 1065bd8deadSopenharmony_ci distance (should be not negative), and the second value of each value pair 1075bd8deadSopenharmony_ci specifies the corresponding value of the fog blend factor. The fog 1085bd8deadSopenharmony_ci blend factor values are clamped to [0.0, 1.0]. The order in which 1095bd8deadSopenharmony_ci the points are specified is significant (if there is more then one 1105bd8deadSopenharmony_ci point) based on the following requirements: 1. distance value of 1115bd8deadSopenharmony_ci each point is not smaller then the distance value of its 1125bd8deadSopenharmony_ci predecessor; 2. fog factor value of each point is not bigger then 1135bd8deadSopenharmony_ci the fog factor value of its predecessor. The <n> value 1145bd8deadSopenharmony_ci pairs in <points> completely specify the function, replacing any previous 1155bd8deadSopenharmony_ci specification that may have existed. At least one control point should be 1165bd8deadSopenharmony_ci specified. The maximum number of control points is implementation dependent 1175bd8deadSopenharmony_ci and may be inquired by Get commands. Initially fog function defined by a 1185bd8deadSopenharmony_ci single point (0.0, 1.0). 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ci Fog factor function is evaluated by fitting a curve through the points 1215bd8deadSopenharmony_ci specified by FogFuncSGIS. This curve may be linear between adjacent points, 1225bd8deadSopenharmony_ci or it may be smoothed, but it will pass exactly through the points, limited 1235bd8deadSopenharmony_ci only by the resolution of the implementation. The value pair with the 1245bd8deadSopenharmony_ci lowest distance value specifies the fog function value for all values of 1255bd8deadSopenharmony_ci distance less than or equal to that pair's distance. Likewise, the value 1265bd8deadSopenharmony_ci pair with the greatest distance value specifies the function value for 1275bd8deadSopenharmony_ci all values of distance greater than or equal to that pair's distance. 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci If <pname> is FOG_MODE, and <param> is, or <params> point to an 1305bd8deadSopenharmony_ci integer FOG_FUNC_SGIS then application specified fog factor function is 1315bd8deadSopenharmony_ci selected for the fog calculation. 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.2 Specification (Per-Fragment Operations 1345bd8deadSopenharmony_ciand the Framebuffer) 1355bd8deadSopenharmony_ci 1365bd8deadSopenharmony_ci None 1375bd8deadSopenharmony_ci 1385bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.2 Specification (Special Functions) 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ci None 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.2 Specification (State and State Requests) 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ci The max allowed number of points in the fog factor function specification 1455bd8deadSopenharmony_ci of a fog is queried by calling GetBooleanv, GetIntegerv, GetFloatv, 1465bd8deadSopenharmony_ci and GetDoublev with <pname> set to MAX_FOG_FUNC_POINTS_SGIS. 1475bd8deadSopenharmony_ci The number of points in the current fog factor function is queried by 1485bd8deadSopenharmony_ci calling GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev with <pname> 1495bd8deadSopenharmony_ci set to FOG_FUNC_POINTS_SGIS. All the points of the current fog 1505bd8deadSopenharmony_ci factor function are queried by calling GetFogFuncSGIS. Points are 1515bd8deadSopenharmony_ci returned in the same format as they are specified in the 1525bd8deadSopenharmony_ci glFogFuncSGIS function. 1535bd8deadSopenharmony_ci 1545bd8deadSopenharmony_ciAdditions to the GLX Specification 1555bd8deadSopenharmony_ci 1565bd8deadSopenharmony_ci None 1575bd8deadSopenharmony_ci 1585bd8deadSopenharmony_ciErrors 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ci INVALID_VALUE is generated if FogFuncSGIS parameter <n> is 1615bd8deadSopenharmony_ci negative. 1625bd8deadSopenharmony_ci 1635bd8deadSopenharmony_ci INVALID_VALUE is generated if eye spce-distance is less then zero. 1645bd8deadSopenharmony_ci 1655bd8deadSopenharmony_ci INVALID_VALUE is generated if specified control points don't confirm 1665bd8deadSopenharmony_ci with order requirements. 1675bd8deadSopenharmony_ci 1685bd8deadSopenharmony_ci INVALID_OPERATION is generated if FogFuncSGIS is executed between 1695bd8deadSopenharmony_ci execution of Begin and the corresponding execution to End. 1705bd8deadSopenharmony_ci 1715bd8deadSopenharmony_ci INVALID_OPERATION is generated if GetFogFuncSGIS is executed 1725bd8deadSopenharmony_ci between execution of Begin and the corresponding execution to 1735bd8deadSopenharmony_ci End. 1745bd8deadSopenharmony_ci 1755bd8deadSopenharmony_ciNew State 1765bd8deadSopenharmony_ci 1775bd8deadSopenharmony_ci Get Value Get Command Type Initial Value Attribute 1785bd8deadSopenharmony_ci --------- ----------- ---- ------------- --------- 1795bd8deadSopenharmony_ci MAX_FOG_FUNC_POINTS_SGIS GetIntegerv Z+ XXX 1805bd8deadSopenharmony_ci FOG_FUNC_POINTS_SGIS GetIntegerv Z+ 1 fog 1815bd8deadSopenharmony_ci FOG_FUNC_SGIS GetFloatv 2 x n x R+ (0.0, 1.0) 1825bd8deadSopenharmony_ci 1835bd8deadSopenharmony_ciNew Implementation Dependent State 1845bd8deadSopenharmony_ci 1855bd8deadSopenharmony_ci None 186