|
1 | 1 | ---Rendering API documentation |
2 | 2 | ---Rendering functions, messages and constants. The "render" namespace is |
3 | 3 | ---accessible only from render scripts. |
4 | | ----The rendering API is built on top of OpenGL ES 2.0, is a subset of the |
| 4 | +---The rendering API was originally built on top of OpenGL ES 2.0, and it uses a subset of the |
5 | 5 | ---OpenGL computer graphics rendering API for rendering 2D and 3D computer |
6 | | ----graphics. OpenGL ES 2.0 is supported on all our target platforms. |
| 6 | +---graphics. Our current target is OpenGLES 3.0 with fallbacks to 2.0 on some platforms. |
7 | 7 | --- It is possible to create materials and write shaders that |
8 | 8 | ---require features not in OpenGL ES 2.0, but those will not work cross platform. |
9 | 9 | ---@class render |
@@ -41,12 +41,24 @@ render.FILTER_LINEAR = nil |
41 | 41 | render.FILTER_NEAREST = nil |
42 | 42 | render.FORMAT_DEPTH = nil |
43 | 43 | render.FORMAT_LUMINANCE = nil |
| 44 | +---May be nil if the format isn't supported |
| 45 | +render.FORMAT_R16F = nil |
| 46 | +---May be nil if the format isn't supported |
| 47 | +render.FORMAT_R32F = nil |
| 48 | +---May be nil if the format isn't supported |
| 49 | +render.FORMAT_RG16F = nil |
| 50 | +---May be nil if the format isn't supported |
| 51 | +render.FORMAT_RG32F = nil |
44 | 52 | render.FORMAT_RGB = nil |
| 53 | +---May be nil if the format isn't supported |
| 54 | +render.FORMAT_RGB16F = nil |
| 55 | +---May be nil if the format isn't supported |
| 56 | +render.FORMAT_RGB32F = nil |
45 | 57 | render.FORMAT_RGBA = nil |
46 | | -render.FORMAT_RGBA_DXT1 = nil |
47 | | -render.FORMAT_RGBA_DXT3 = nil |
48 | | -render.FORMAT_RGBA_DXT5 = nil |
49 | | -render.FORMAT_RGB_DXT1 = nil |
| 58 | +---May be nil if the format isn't supported |
| 59 | +render.FORMAT_RGBA16F = nil |
| 60 | +---May be nil if the format isn't supported |
| 61 | +render.FORMAT_RGBA32F = nil |
50 | 62 | render.FORMAT_STENCIL = nil |
51 | 63 | render.RENDER_TARGET_DEFAULT = nil |
52 | 64 | render.STATE_BLEND = nil |
@@ -96,11 +108,12 @@ function render.disable_texture(unit) end |
96 | 108 | ---system constants buffer is used containing constants as defined in materials and set through |
97 | 109 | ---go.set <> (or particlefx.set_constant <>) on visual components. |
98 | 110 | ---@param predicate predicate predicate to draw for |
99 | | ----@param constants constant_buffer optional constants to use while rendering |
100 | | -function render.draw(predicate, constants) end |
| 111 | +---@param options table optional table with properties: |
| 112 | +function render.draw(predicate, options) end |
101 | 113 |
|
102 | 114 | ---Draws all 3d debug graphics such as lines drawn with "draw_line" messages and physics visualization. |
103 | | -function render.draw_debug3d() end |
| 115 | +---@param options table optional table with properties: |
| 116 | +function render.draw_debug3d(options) end |
104 | 117 |
|
105 | 118 | ---If another material was already enabled, it will be automatically disabled |
106 | 119 | ---and the specified material is used instead. |
@@ -173,7 +186,7 @@ function render.predicate(tags) end |
173 | 186 | ---of parameters. The following parameter keys are available: |
174 | 187 | --- |
175 | 188 | ---Key Values |
176 | | ----format render.FORMAT_LUMINANCErender.FORMAT_RGBrender.FORMAT_RGBA render.FORMAT_RGB_DXT1render.FORMAT_RGBA_DXT1render.FORMAT_RGBA_DXT3 render.FORMAT_RGBA_DXT5render.FORMAT_DEPTHrender.FORMAT_STENCIL |
| 189 | +---format render.FORMAT_LUMINANCErender.FORMAT_RGBrender.FORMAT_RGBArender.FORMAT_DEPTHrender.FORMAT_STENCILrender.FORMAT_RGBA32Frender.FORMAT_RGBA16F |
177 | 190 | ---width number |
178 | 191 | ---height number |
179 | 192 | ---min_filter render.FILTER_LINEARrender.FILTER_NEAREST |
@@ -292,7 +305,7 @@ function render.set_depth_mask(depth) end |
292 | 305 | ---offset for each polygon. The initial value is 0. |
293 | 306 | ---units is multiplied by an implementation-specific value to create a |
294 | 307 | ---constant depth offset. The initial value is 0. |
295 | | ----The value of the offset is computed as factor ? DZ + r ? units |
| 308 | +---The value of the offset is computed as factor × DZ + r × units |
296 | 309 | ---DZ is a measurement of the depth slope of the polygon which is the change in z (depth) |
297 | 310 | ---values divided by the change in either x or y coordinates, as you traverse a polygon. |
298 | 311 | ---The depth values are in window coordinates, clamped to the range [0, 1]. |
|
0 commit comments