@tlua/gmod 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/README.md +28 -0
  2. package/__metadata.json +4 -0
  3. package/_globals.d.tlua +178 -0
  4. package/_gmod-std.d.tlua +35 -0
  5. package/achievementicon.d.tlua +12 -0
  6. package/achievements.d.tlua +162 -0
  7. package/ai.d.tlua +65 -0
  8. package/ai_schedule.d.tlua +17 -0
  9. package/ai_task.d.tlua +17 -0
  10. package/angle.d.tlua +197 -0
  11. package/avatarimage.d.tlua +10 -0
  12. package/awesomium.d.tlua +14 -0
  13. package/baseclass.d.tlua +42 -0
  14. package/bf_read.d.tlua +110 -0
  15. package/bit.d.tlua +121 -0
  16. package/button.d.tlua +13 -0
  17. package/cam.d.tlua +220 -0
  18. package/ceffectdata.d.tlua +337 -0
  19. package/chat.d.tlua +62 -0
  20. package/checkbutton.d.tlua +14 -0
  21. package/cleanup.d.tlua +88 -0
  22. package/cluaemitter.d.tlua +119 -0
  23. package/clualocomotion.d.tlua +383 -0
  24. package/cluaparticle.d.tlua +426 -0
  25. package/cmovedata.d.tlua +476 -0
  26. package/cnavarea.d.tlua +845 -0
  27. package/cnavladder.d.tlua +209 -0
  28. package/cnewparticleeffect.d.tlua +259 -0
  29. package/color.d.tlua +339 -0
  30. package/concommand.d.tlua +69 -0
  31. package/constraint.d.tlua +311 -0
  32. package/construct.d.tlua +26 -0
  33. package/contentheader.d.tlua +32 -0
  34. package/contenticon.d.tlua +86 -0
  35. package/contentsidebar.d.tlua +45 -0
  36. package/contentsidebartoolbox.d.tlua +13 -0
  37. package/contextbase.d.tlua +37 -0
  38. package/controlpanel.d.tlua +140 -0
  39. package/controlpresets.d.tlua +118 -0
  40. package/convar.d.tlua +162 -0
  41. package/cookie.d.tlua +60 -0
  42. package/coroutine.d.tlua +90 -0
  43. package/crecipientfilter.d.tlua +152 -0
  44. package/csent.d.tlua +10 -0
  45. package/csoundpatch.d.tlua +150 -0
  46. package/ctakedamageinfo.d.tlua +366 -0
  47. package/ctrllistbox.d.tlua +12 -0
  48. package/ctrlnumpad.d.tlua +73 -0
  49. package/cusercmd.d.tlua +320 -0
  50. package/custom_classes.d.tlua +65 -0
  51. package/custom_entity_fields.d.tlua +96 -0
  52. package/cvars.d.tlua +80 -0
  53. package/dadjustablemodelpanel.d.tlua +81 -0
  54. package/dalphabar.d.tlua +27 -0
  55. package/dbinder.d.tlua +37 -0
  56. package/dbubblecontainer.d.tlua +18 -0
  57. package/dbutton.d.tlua +88 -0
  58. package/dcategoryheader.d.tlua +13 -0
  59. package/dcategorylist.d.tlua +11 -0
  60. package/dcheckbox.d.tlua +46 -0
  61. package/dcheckboxlabel.d.tlua +90 -0
  62. package/dcollapsiblecategory.d.tlua +240 -0
  63. package/dcolorbutton.d.tlua +73 -0
  64. package/dcolorcombo.d.tlua +54 -0
  65. package/dcolorcube.d.tlua +137 -0
  66. package/dcolormixer.d.tlua +303 -0
  67. package/dcolorpalette.d.tlua +294 -0
  68. package/dcolumnsheet.d.tlua +49 -0
  69. package/dcombobox.d.tlua +161 -0
  70. package/ddragbase.d.tlua +151 -0
  71. package/ddrawer.d.tlua +72 -0
  72. package/debug.d.tlua +236 -0
  73. package/debugoverlay.d.tlua +193 -0
  74. package/dentityproperties.d.tlua +63 -0
  75. package/derma.d.tlua +119 -0
  76. package/dexpandbutton.d.tlua +30 -0
  77. package/dfilebrowser.d.tlua +228 -0
  78. package/dform.d.tlua +176 -0
  79. package/dframe.d.tlua +261 -0
  80. package/dgrid.d.tlua +113 -0
  81. package/dhorizontaldivider.d.tlua +196 -0
  82. package/dhorizontalscroller.d.tlua +104 -0
  83. package/dhscrollbar.d.tlua +109 -0
  84. package/dhtml.d.tlua +91 -0
  85. package/dhtmlcontrols.d.tlua +62 -0
  86. package/diconbrowser.d.tlua +113 -0
  87. package/diconlayout.d.tlua +190 -0
  88. package/dimage.d.tlua +221 -0
  89. package/dimagebutton.d.tlua +103 -0
  90. package/dkillicon.d.tlua +9 -0
  91. package/dlabel.d.tlua +385 -0
  92. package/dlabeleditable.d.tlua +51 -0
  93. package/dlabelurl.d.tlua +100 -0
  94. package/dlistbox.d.tlua +82 -0
  95. package/dlistboxitem.d.tlua +42 -0
  96. package/dlistlayout.d.tlua +14 -0
  97. package/dlistview.d.tlua +360 -0
  98. package/dlistview_column.d.tlua +135 -0
  99. package/dlistview_columnplain.d.tlua +11 -0
  100. package/dlistview_draggerbar.d.tlua +11 -0
  101. package/dlistview_line.d.tlua +140 -0
  102. package/dlistviewheaderlabel.d.tlua +11 -0
  103. package/dlistviewlabel.d.tlua +11 -0
  104. package/dlistviewline.d.tlua +11 -0
  105. package/dmenu.d.tlua +266 -0
  106. package/dmenubar.d.tlua +42 -0
  107. package/dmenuoption.d.tlua +135 -0
  108. package/dmenuoptioncvar.d.tlua +64 -0
  109. package/dmodelpanel.d.tlua +207 -0
  110. package/dmodelselect.d.tlua +20 -0
  111. package/dmodelselectmulti.d.tlua +19 -0
  112. package/dnotify.d.tlua +93 -0
  113. package/dnumberscratch.d.tlua +284 -0
  114. package/dnumberwang.d.tlua +147 -0
  115. package/dnumpad.d.tlua +11 -0
  116. package/dnumslider.d.tlua +182 -0
  117. package/dpanel.d.tlua +152 -0
  118. package/dpanellist.d.tlua +109 -0
  119. package/dpaneloverlay.d.tlua +65 -0
  120. package/dpanelselect.d.tlua +13 -0
  121. package/dpanpanel.d.tlua +64 -0
  122. package/dprogress.d.tlua +27 -0
  123. package/dproperties.d.tlua +52 -0
  124. package/dproperty_boolean.d.tlua +12 -0
  125. package/dproperty_combo.d.tlua +31 -0
  126. package/dproperty_entity.d.tlua +12 -0
  127. package/dproperty_float.d.tlua +12 -0
  128. package/dproperty_generic.d.tlua +50 -0
  129. package/dproperty_int.d.tlua +12 -0
  130. package/dproperty_vectorcolor.d.tlua +14 -0
  131. package/dpropertysheet.d.tlua +167 -0
  132. package/dragndrop.d.tlua +123 -0
  133. package/draw.d.tlua +162 -0
  134. package/drgbpicker.d.tlua +49 -0
  135. package/drive.d.tlua +159 -0
  136. package/dscrollbargrip.d.tlua +13 -0
  137. package/dscrollpanel.d.tlua +110 -0
  138. package/dshape.d.tlua +72 -0
  139. package/dsizetocontents.d.tlua +46 -0
  140. package/dslider.d.tlua +302 -0
  141. package/dsprite.d.tlua +84 -0
  142. package/dtab.d.tlua +81 -0
  143. package/dtextentry.d.tlua +442 -0
  144. package/dtilelayout.d.tlua +218 -0
  145. package/dtooltip.d.tlua +76 -0
  146. package/dtree.d.tlua +185 -0
  147. package/dtree_node.d.tlua +793 -0
  148. package/dtree_node_button.d.tlua +13 -0
  149. package/duplicator.d.tlua +338 -0
  150. package/dverticaldivider.d.tlua +223 -0
  151. package/dvscrollbar.d.tlua +109 -0
  152. package/editablepanel.d.tlua +10 -0
  153. package/effect.d.tlua +121 -0
  154. package/effects.d.tlua +77 -0
  155. package/engine.d.tlua +248 -0
  156. package/entity.d.tlua +8295 -0
  157. package/ents.d.tlua +267 -0
  158. package/enums.d.tlua +7082 -0
  159. package/file.d.tlua +419 -0
  160. package/file_class.d.tlua +7 -0
  161. package/fingerposer.d.tlua +12 -0
  162. package/fingervar.d.tlua +13 -0
  163. package/frame.d.tlua +11 -0
  164. package/frame_blend.d.tlua +105 -0
  165. package/game.d.tlua +482 -0
  166. package/gameevent.d.tlua +968 -0
  167. package/gamemode.d.tlua +48 -0
  168. package/global.d.tlua +3156 -0
  169. package/gm.d.tlua +3218 -0
  170. package/gmod.d.tlua +20 -0
  171. package/gmsave.d.tlua +53 -0
  172. package/gui.d.tlua +232 -0
  173. package/gwen.d.tlua +55 -0
  174. package/halo.d.tlua +42 -0
  175. package/hammer.d.tlua +17 -0
  176. package/hook.d.tlua +64 -0
  177. package/html.d.tlua +22 -0
  178. package/http.d.tlua +72 -0
  179. package/iconeditor.d.tlua +130 -0
  180. package/igmodaudiochannel.d.tlua +419 -0
  181. package/imagecheckbox.d.tlua +48 -0
  182. package/imaterial.d.tlua +288 -0
  183. package/imesh.d.tlua +70 -0
  184. package/index.d.tlua +277 -0
  185. package/input.d.tlua +252 -0
  186. package/invalidateinternalentitycache.d.tlua +13 -0
  187. package/irestore.d.tlua +94 -0
  188. package/isave.d.tlua +94 -0
  189. package/itexture.d.tlua +108 -0
  190. package/ivideowriter.d.tlua +53 -0
  191. package/jit.d.tlua +243 -0
  192. package/killicon.d.tlua +84 -0
  193. package/label.d.tlua +20 -0
  194. package/language.d.tlua +26 -0
  195. package/list.d.tlua +112 -0
  196. package/makeballoon.d.tlua +15 -0
  197. package/markup.d.tlua +38 -0
  198. package/markupobject.d.tlua +53 -0
  199. package/material.d.tlua +9 -0
  200. package/math.d.tlua +899 -0
  201. package/matproxy.d.tlua +60 -0
  202. package/matselect.d.tlua +106 -0
  203. package/menu.d.tlua +20 -0
  204. package/menubar.d.tlua +39 -0
  205. package/mesh.d.tlua +183 -0
  206. package/modelimage.d.tlua +12 -0
  207. package/motionsensor.d.tlua +115 -0
  208. package/navmesh.d.tlua +274 -0
  209. package/net.d.tlua +639 -0
  210. package/nextbot.d.tlua +380 -0
  211. package/notification.d.tlua +35 -0
  212. package/npc.d.tlua +1787 -0
  213. package/numpad.d.tlua +89 -0
  214. package/os.d.tlua +56 -0
  215. package/package.d.tlua +15 -0
  216. package/package.json +18 -0
  217. package/panel.d.tlua +3650 -0
  218. package/panellist.d.tlua +13 -0
  219. package/pathfollower.d.tlua +301 -0
  220. package/permissions.d.tlua +77 -0
  221. package/physcollide.d.tlua +40 -0
  222. package/physenv.d.tlua +136 -0
  223. package/physobj.d.tlua +799 -0
  224. package/pixelvis_handle_t.d.tlua +9 -0
  225. package/player.d.tlua +3320 -0
  226. package/player_manager.d.tlua +147 -0
  227. package/preseteditor.d.tlua +13 -0
  228. package/presets.d.tlua +79 -0
  229. package/projectedtexture.d.tlua +553 -0
  230. package/properties.d.tlua +65 -0
  231. package/propselect.d.tlua +50 -0
  232. package/radiobutton.d.tlua +13 -0
  233. package/render.d.tlua +1700 -0
  234. package/resource.d.tlua +73 -0
  235. package/richtext.d.tlua +17 -0
  236. package/sandbox.d.tlua +576 -0
  237. package/saverestore.d.tlua +148 -0
  238. package/schedule.d.tlua +69 -0
  239. package/scripted_ents.d.tlua +124 -0
  240. package/search.d.tlua +26 -0
  241. package/serverlist.d.tlua +85 -0
  242. package/slidebar.d.tlua +12 -0
  243. package/slider.d.tlua +11 -0
  244. package/sound.d.tlua +140 -0
  245. package/spawnicon.d.tlua +95 -0
  246. package/spawnmenu.d.tlua +286 -0
  247. package/spawnmenucontentpanel.d.tlua +52 -0
  248. package/sql.d.tlua +154 -0
  249. package/stack.d.tlua +57 -0
  250. package/steamworks.d.tlua +208 -0
  251. package/string.d.tlua +535 -0
  252. package/structures.d.tlua +4442 -0
  253. package/surface.d.tlua +463 -0
  254. package/surfaceinfo.d.tlua +70 -0
  255. package/system.d.tlua +134 -0
  256. package/table.d.tlua +533 -0
  257. package/task.d.tlua +92 -0
  258. package/team.d.tlua +195 -0
  259. package/textentry.d.tlua +12 -0
  260. package/tgaimage.d.tlua +11 -0
  261. package/timer.d.tlua +198 -0
  262. package/tool.d.tlua +466 -0
  263. package/ugcpublishwindow.d.tlua +83 -0
  264. package/umsg.d.tlua +147 -0
  265. package/undo.d.tlua +122 -0
  266. package/urllabel.d.tlua +13 -0
  267. package/usermessage.d.tlua +48 -0
  268. package/utf8.d.tlua +89 -0
  269. package/util.d.tlua +1087 -0
  270. package/vector.d.tlua +413 -0
  271. package/vehicle.d.tlua +472 -0
  272. package/vgui.d.tlua +201 -0
  273. package/video.d.tlua +17 -0
  274. package/vmatrix.d.tlua +392 -0
  275. package/weapon.d.tlua +913 -0
  276. package/weapons.d.tlua +90 -0
  277. package/widgets.d.tlua +29 -0
  278. package/workshopfilebase.d.tlua +68 -0
package/render.d.tlua ADDED
@@ -0,0 +1,1700 @@
1
+ // AUTO-GENERATED tlua declarations. Do not edit by hand.
2
+
3
+ /**
4
+ * The render library is a powerful set of functions that let you control how the world and its contents are rendered. It can also be used to draw some 3D clientside effects such as beams, boxes and spheres.
5
+ * @source https://wiki.facepunch.com/gmod/render
6
+ */
7
+ declare render: RenderLib;
8
+
9
+ interface RenderLib {
10
+ /**
11
+ * Adds a Beam Segment to the Beam started by [render.StartBeam](https://wiki.facepunch.com/gmod/render.StartBeam).
12
+ *
13
+ * For more detailed information on Beams, as well as usage examples, see the [Beams Render Reference](https://wiki.facepunch.com/gmod/render_beams).
14
+ *
15
+ * @realm client
16
+ * @source https://wiki.facepunch.com/gmod/render.AddBeam
17
+ */
18
+ AddBeam(startPos: Vector, width: number, textureEnd: number, color: Color): void;
19
+ }
20
+
21
+ interface RenderLib {
22
+ /**
23
+ * Blurs the render target ( or a given texture ).
24
+ *
25
+ * **WARNING**: Calling this on a RenderTarget created with TEXTUREFLAGS_POINTSAMPLE will result in strange visual glitching.
26
+ *
27
+ *
28
+ * @realm client
29
+ * @source https://wiki.facepunch.com/gmod/render.BlurRenderTarget
30
+ */
31
+ BlurRenderTarget(rendertarget: ITexture, blurx: number, blury: number, passes: number): void;
32
+ }
33
+
34
+ interface RenderLib {
35
+ /**
36
+ * This function overrides the brush material for next render operations. It can be used with [Entity:DrawModel](https://wiki.facepunch.com/gmod/Entity:DrawModel).
37
+ * @realm client
38
+ * @source https://wiki.facepunch.com/gmod/render.BrushMaterialOverride
39
+ */
40
+ BrushMaterialOverride(mat?: IMaterial): void;
41
+ }
42
+
43
+ interface RenderLib {
44
+ /**
45
+ * Captures a part of the current render target and returns the data as a binary string in the given format.
46
+ *
47
+ * Since the pixel buffer clears itself every frame, this will return a black screen outside of render hooks. To capture the user's final view, use [GM:PostRender](https://wiki.facepunch.com/gmod/GM:PostRender). This will not capture the Steam overlay or third-party injections (such as the Discord overlay, Overwolf, and advanced cheats) on the user's screen.
48
+ *
49
+ * **WARNING**: In PNG mode, this function can produce unexpected result where foreground is rendered as transparent.
50
+ * This is caused by [render.SetWriteDepthToDestAlpha](https://wiki.facepunch.com/gmod/render.SetWriteDepthToDestAlpha) set to `true` when doing most of render operations, including rendering in `_rt_fullframefb`. If you want to capture render target's content as PNG image only for output quality, set [Structures/RenderCaptureData](https://wiki.facepunch.com/gmod/Structures/RenderCaptureData)'s `alpha` to `false` when capturing render targets with [render.SetWriteDepthToDestAlpha](https://wiki.facepunch.com/gmod/render.SetWriteDepthToDestAlpha) set to `true`.
51
+ *
52
+ *
53
+ * **WARNING**: This function will return nil if escape menu is open
54
+ *
55
+ *
56
+ *
57
+ * @realm client
58
+ * @source https://wiki.facepunch.com/gmod/render.Capture
59
+ */
60
+ Capture(captureData: RenderCaptureData): string;
61
+ }
62
+
63
+ interface RenderLib {
64
+ /**
65
+ * Dumps the current render target and allows the pixels to be accessed by [render.ReadPixel](https://wiki.facepunch.com/gmod/render.ReadPixel).
66
+ *
67
+ * Capturing outside a render hook will return an image filled with `0 0 0 255`.
68
+ *
69
+ * See also [render.Capture](https://wiki.facepunch.com/gmod/render.Capture).
70
+ *
71
+ * @realm client
72
+ * @source https://wiki.facepunch.com/gmod/render.CapturePixels
73
+ */
74
+ CapturePixels(): void;
75
+ }
76
+
77
+ interface RenderLib {
78
+ /**
79
+ * Clears the current render target and the specified buffers.
80
+ *
81
+ * This sets the alpha incorrectly for [surface](https://wiki.facepunch.com/gmod/surface) draw calls for render targets.
82
+ *
83
+ * @realm client and menu
84
+ * @source https://wiki.facepunch.com/gmod/render.Clear
85
+ */
86
+ Clear(r: number, g: number, b: number, a: number, clearDepth?: boolean, clearStencil?: boolean): void;
87
+ }
88
+
89
+ interface RenderLib {
90
+ /**
91
+ * Tests every pixel of the active [Render Target](https://wiki.facepunch.com/gmod/render_rendertargets) against the current Stencil configuration and sets the Color Channel values and, optionally, the Depth Buffer values for every pixel that passes.
92
+ *
93
+ * For more detailed information on the Stencil system, including usage examples, see the [Stencils Render Reference](https://wiki.facepunch.com/gmod/render_stencils) page
94
+ *
95
+ * **NOTE**: This function does **not** clear the Stencil Buffer on its own.
96
+ * If you would like to clear the Stencil Buffer, you can use [render.ClearStencil](https://wiki.facepunch.com/gmod/render.ClearStencil)
97
+ *
98
+ *
99
+ * @realm client and menu
100
+ * @source https://wiki.facepunch.com/gmod/render.ClearBuffersObeyStencil
101
+ */
102
+ ClearBuffersObeyStencil(red: number, green: number, blue: number, alpha: number, clearDepth: boolean): void;
103
+ }
104
+
105
+ interface RenderLib {
106
+ /**
107
+ * Resets the depth buffer.
108
+ *
109
+ * @realm client and menu
110
+ * @source https://wiki.facepunch.com/gmod/render.ClearDepth
111
+ */
112
+ ClearDepth(clearStencil?: boolean): void;
113
+ }
114
+
115
+ interface RenderLib {
116
+ /**
117
+ * Clears a render target.
118
+ *
119
+ * It uses [render.Clear](https://wiki.facepunch.com/gmod/render.Clear) then [render.SetRenderTarget](https://wiki.facepunch.com/gmod/render.SetRenderTarget) on the modified render target.
120
+ *
121
+ * @realm client
122
+ * @source https://wiki.facepunch.com/gmod/render.ClearRenderTarget
123
+ */
124
+ ClearRenderTarget(texture: ITexture, color: Color): void;
125
+ }
126
+
127
+ interface RenderLib {
128
+ /**
129
+ * Sets the Stencil Buffer value to `0` for all pixels in the currently active [Render Target](https://wiki.facepunch.com/gmod/render_rendertargets).
130
+ *
131
+ * For more detailed information on the Stencil system, including usage examples, see the [Stencils Render Reference](https://wiki.facepunch.com/gmod/render_stencils) page.
132
+ *
133
+ * @realm client and menu
134
+ * @source https://wiki.facepunch.com/gmod/render.ClearStencil
135
+ */
136
+ ClearStencil(): void;
137
+ }
138
+
139
+ interface RenderLib {
140
+ /**
141
+ * Sets the Stencil Buffer value for every pixel in a given rectangle to a given value.
142
+ *
143
+ * This is **not** affected by [render.SetStencilWriteMask](https://wiki.facepunch.com/gmod/render.SetStencilWriteMask).
144
+ *
145
+ * For more detailed information on the Stencil system, including usage examples, see the [Stencils Render Reference](https://wiki.facepunch.com/gmod/render_stencils) page.
146
+ *
147
+ * @realm client and menu
148
+ * @source https://wiki.facepunch.com/gmod/render.ClearStencilBufferRectangle
149
+ */
150
+ ClearStencilBufferRectangle(startX: number, startY: number, endX: number, endY: number, stencilBufferValue: number): void;
151
+ }
152
+
153
+ interface RenderLib {
154
+ /**
155
+ * Calculates the lighting caused by dynamic lights (such as [Global.DynamicLight](https://wiki.facepunch.com/gmod/Global.DynamicLight) and the Light Sandbox tool) for the specified surface. This will not include map ambient light.
156
+ *
157
+ * See also [render.ComputeLighting](https://wiki.facepunch.com/gmod/render.ComputeLighting) for a function that also includes map's ambient lighting.
158
+ *
159
+ * @realm client
160
+ * @source https://wiki.facepunch.com/gmod/render.ComputeDynamicLighting
161
+ */
162
+ ComputeDynamicLighting(position: Vector, normal: Vector): Vector;
163
+ }
164
+
165
+ interface RenderLib {
166
+ /**
167
+ * Calculates the light color at a certain position.
168
+ *
169
+ * This includes both ambient light and dynamic light.
170
+ *
171
+ * See [render.ComputeDynamicLighting](https://wiki.facepunch.com/gmod/render.ComputeDynamicLighting) for dynamic light only.
172
+ *
173
+ * See [render.GetAmbientLightColor](https://wiki.facepunch.com/gmod/render.GetAmbientLightColor) for map-wide ambient color.
174
+ *
175
+ * @realm client
176
+ * @source https://wiki.facepunch.com/gmod/render.ComputeLighting
177
+ */
178
+ ComputeLighting(position: Vector, normal: Vector): Vector;
179
+ }
180
+
181
+ interface RenderLib {
182
+ /**
183
+ * Calculates diameter of a 3D sphere on a 2D screen.
184
+ *
185
+ *
186
+ *
187
+ * @realm client
188
+ * @source https://wiki.facepunch.com/gmod/render.ComputePixelDiameterOfSphere
189
+ */
190
+ ComputePixelDiameterOfSphere(point: Vector, radius: number): number;
191
+ }
192
+
193
+ interface RenderLib {
194
+ /**
195
+ * Copies the currently active Render Target to the specified texture.
196
+ * **WARNING**: This does not copy the Depth buffer, no method for that is known at this moment so a common workaround is to store the source texture somewhere else, perform your drawing operations, save the result somewhere else and reapply the source texture.
197
+ *
198
+ *
199
+ * @realm client
200
+ * @source https://wiki.facepunch.com/gmod/render.CopyRenderTargetToTexture
201
+ */
202
+ CopyRenderTargetToTexture(Target: ITexture): void;
203
+ }
204
+
205
+ interface RenderLib {
206
+ /**
207
+ * Copies the contents of one texture to another. Only works with rendertargets.
208
+ * **WARNING**: This does not copy the Depth buffer, no method for that is known at this moment so a common workaround is to store the source texture somewhere else, perform your drawing operations, save the result somewhere else and reapply the source texture.
209
+ *
210
+ *
211
+ * @realm client
212
+ * @source https://wiki.facepunch.com/gmod/render.CopyTexture
213
+ */
214
+ CopyTexture(texture_from: ITexture, texture_to: ITexture): void;
215
+ }
216
+
217
+ interface RenderLib {
218
+ /**
219
+ * Sets the cull mode. The culling mode defines how back faces are culled when rendering geometry.
220
+ * @realm client and menu
221
+ * @source https://wiki.facepunch.com/gmod/render.CullMode
222
+ */
223
+ CullMode(cullMode: number): void;
224
+ }
225
+
226
+ interface RenderLib {
227
+ /**
228
+ * Set's the depth range of the upcoming render.
229
+ * @realm client
230
+ * @source https://wiki.facepunch.com/gmod/render.DepthRange
231
+ */
232
+ DepthRange(depthmin: number, depthmax: number): void;
233
+ }
234
+
235
+ interface RenderLib {
236
+ /**
237
+ * Draws a single-segment Beam made out of a textured, billboarded quad stretching between two points.
238
+ *
239
+ * For more detailed information, including usage examples, see the [Beams Render Reference](https://wiki.facepunch.com/gmod/render_beams).
240
+ *
241
+ * @realm client
242
+ * @source https://wiki.facepunch.com/gmod/render.DrawBeam
243
+ */
244
+ DrawBeam(startPos: Vector, endPos: Vector, width: number, textureStart: number, textureEnd: number, color?: Color): void;
245
+ }
246
+
247
+ interface RenderLib {
248
+ /**
249
+ * Draws a box in 3D space.
250
+ *
251
+ *
252
+ *
253
+ * @realm client
254
+ * @source https://wiki.facepunch.com/gmod/render.DrawBox
255
+ */
256
+ DrawBox(position: Vector, angles: Angle, mins: Vector, maxs: Vector, color?: Color): void;
257
+ }
258
+
259
+ interface RenderLib {
260
+ /**
261
+ * Draws a line in 3D space.
262
+ *
263
+ *
264
+ *
265
+ * @realm client
266
+ * @source https://wiki.facepunch.com/gmod/render.DrawLine
267
+ */
268
+ DrawLine(startPos: Vector, endPos: Vector, color?: Color, writeZ?: boolean): void;
269
+ }
270
+
271
+ interface RenderLib {
272
+ /**
273
+ * Draws 2 connected triangles. Expects material to be set by [render.SetMaterial](https://wiki.facepunch.com/gmod/render.SetMaterial).
274
+ *
275
+ *
276
+ *
277
+ * @realm client
278
+ * @source https://wiki.facepunch.com/gmod/render.DrawQuad
279
+ */
280
+ DrawQuad(vert1: Vector, vert2: Vector, vert3: Vector, vert4: Vector, color?: Color): void;
281
+ }
282
+
283
+ interface RenderLib {
284
+ /**
285
+ * Draws a quad. Expects material to be set by [render.SetMaterial](https://wiki.facepunch.com/gmod/render.SetMaterial).
286
+ *
287
+ *
288
+ *
289
+ * @realm client
290
+ * @source https://wiki.facepunch.com/gmod/render.DrawQuadEasy
291
+ */
292
+ DrawQuadEasy(position: Vector, normal: Vector, width: number, height: number, color: Color, rotation?: number): void;
293
+ }
294
+
295
+ interface RenderLib {
296
+ /**
297
+ * Draws the current material set by [render.SetMaterial](https://wiki.facepunch.com/gmod/render.SetMaterial) to the whole screen. The color cannot be customized.
298
+ *
299
+ * See also [render.DrawScreenQuadEx](https://wiki.facepunch.com/gmod/render.DrawScreenQuadEx).
300
+ *
301
+ *
302
+ *
303
+ * @realm client
304
+ * @source https://wiki.facepunch.com/gmod/render.DrawScreenQuad
305
+ */
306
+ DrawScreenQuad(applyPoster?: boolean): void;
307
+ }
308
+
309
+ interface RenderLib {
310
+ /**
311
+ * Draws the current material set by [render.SetMaterial](https://wiki.facepunch.com/gmod/render.SetMaterial) to the area specified. Color cannot be customized.
312
+ *
313
+ * See also [render.DrawScreenQuad](https://wiki.facepunch.com/gmod/render.DrawScreenQuad).
314
+ *
315
+ *
316
+ *
317
+ * @realm client
318
+ * @source https://wiki.facepunch.com/gmod/render.DrawScreenQuadEx
319
+ */
320
+ DrawScreenQuadEx(startX: number, startY: number, width: number, height: number): void;
321
+ }
322
+
323
+ interface RenderLib {
324
+ /**
325
+ * Draws a sphere in 3D space. The material previously set with [render.SetMaterial](https://wiki.facepunch.com/gmod/render.SetMaterial) will be applied the sphere's surface.
326
+ *
327
+ * See also [render.DrawWireframeSphere](https://wiki.facepunch.com/gmod/render.DrawWireframeSphere) for a wireframe equivalent.
328
+ *
329
+ *
330
+ *
331
+ * @realm client
332
+ * @source https://wiki.facepunch.com/gmod/render.DrawSphere
333
+ */
334
+ DrawSphere(position: Vector, radius: number, longitudeSteps: number, latitudeSteps: number, color?: Color): void;
335
+ }
336
+
337
+ interface RenderLib {
338
+ /**
339
+ * Draws a sprite in 3D space.
340
+ *
341
+ *
342
+ *
343
+ * @realm client
344
+ * @source https://wiki.facepunch.com/gmod/render.DrawSprite
345
+ */
346
+ DrawSprite(position: Vector, width: number, height: number, color?: Color): void;
347
+ }
348
+
349
+ interface RenderLib {
350
+ /**
351
+ * Draws a texture over the whole screen.
352
+ *
353
+ *
354
+ *
355
+ * @realm client
356
+ * @source https://wiki.facepunch.com/gmod/render.DrawTextureToScreen
357
+ */
358
+ DrawTextureToScreen(tex: ITexture): void;
359
+ }
360
+
361
+ interface RenderLib {
362
+ /**
363
+ * Draws a textured rectangle.
364
+ *
365
+ *
366
+ *
367
+ * @realm client
368
+ * @source https://wiki.facepunch.com/gmod/render.DrawTextureToScreenRect
369
+ */
370
+ DrawTextureToScreenRect(tex: ITexture, x: number, y: number, width: number, height: number): void;
371
+ }
372
+
373
+ interface RenderLib {
374
+ /**
375
+ * Draws a wireframe box in 3D space.
376
+ *
377
+ *
378
+ *
379
+ * @realm client
380
+ * @source https://wiki.facepunch.com/gmod/render.DrawWireframeBox
381
+ */
382
+ DrawWireframeBox(position: Vector, angle: Angle, mins: Vector, maxs: Vector, color?: Color, writeZ?: boolean): void;
383
+ }
384
+
385
+ interface RenderLib {
386
+ /**
387
+ * Draws a wireframe sphere in 3d space.
388
+ *
389
+ *
390
+ *
391
+ * @realm client
392
+ * @source https://wiki.facepunch.com/gmod/render.DrawWireframeSphere
393
+ */
394
+ DrawWireframeSphere(position: Vector, radius: number, longitudeSteps: number, latitudeSteps: number, color?: Color, writeZ?: boolean): void;
395
+ }
396
+
397
+ interface RenderLib {
398
+ /**
399
+ * Sets the status of the clip renderer, returning previous state.
400
+ *
401
+ * **WARNING**: To prevent unintended rendering behavior of other mods/the game, you must reset the clipping state to its previous value.
402
+ *
403
+ *
404
+ * @realm client and menu
405
+ * @source https://wiki.facepunch.com/gmod/render.EnableClipping
406
+ */
407
+ EnableClipping(state: boolean): boolean;
408
+ }
409
+
410
+ interface RenderLib {
411
+ /**
412
+ * Ends the beam mesh of a beam started with [render.StartBeam](https://wiki.facepunch.com/gmod/render.StartBeam).
413
+ *
414
+ * For more detailed information on Beams, as well as usage examples, see the [Beams Render Reference](https://wiki.facepunch.com/gmod/render_beams).
415
+ *
416
+ * @realm client
417
+ * @source https://wiki.facepunch.com/gmod/render.EndBeam
418
+ */
419
+ EndBeam(): void;
420
+ }
421
+
422
+ interface RenderLib {
423
+ /**
424
+ * Sets the color of the fog.
425
+ * @realm client
426
+ * @source https://wiki.facepunch.com/gmod/render.FogColor
427
+ */
428
+ FogColor(red: number, green: number, blue: number): void;
429
+ }
430
+
431
+ interface RenderLib {
432
+ /**
433
+ * Sets the at which the fog reaches its max density.
434
+ * @realm client
435
+ * @source https://wiki.facepunch.com/gmod/render.FogEnd
436
+ */
437
+ FogEnd(distance: number): void;
438
+ }
439
+
440
+ interface RenderLib {
441
+ /**
442
+ * Sets the maximum density of the fog.
443
+ * @realm client
444
+ * @source https://wiki.facepunch.com/gmod/render.FogMaxDensity
445
+ */
446
+ FogMaxDensity(maxDensity: number): void;
447
+ }
448
+
449
+ interface RenderLib {
450
+ /**
451
+ * Sets the mode of fog.
452
+ * @realm client
453
+ * @source https://wiki.facepunch.com/gmod/render.FogMode
454
+ */
455
+ FogMode(fogMode: MATERIAL_FOG): void;
456
+ }
457
+
458
+ interface RenderLib {
459
+ /**
460
+ * Sets the distance at which the fog starts showing up.
461
+ * @realm client
462
+ * @source https://wiki.facepunch.com/gmod/render.FogStart
463
+ */
464
+ FogStart(fogStart: number): void;
465
+ }
466
+
467
+ interface RenderLib {
468
+ /**
469
+ * Returns the ambient color intensity of the map, basically the color the sky emits.
470
+ *
471
+ * This is used by the engine to calculate shadow color using the following formula: `ambientLight * 3 + Vector( 0.3, 0.3, 0.3 )`
472
+ *
473
+ * See also [render.ComputeLighting](https://wiki.facepunch.com/gmod/render.ComputeLighting).
474
+ *
475
+ * @realm client
476
+ * @source https://wiki.facepunch.com/gmod/render.GetAmbientLightColor
477
+ */
478
+ GetAmbientLightColor(): Vector;
479
+ }
480
+
481
+ interface RenderLib {
482
+ /**
483
+ * Returns the current alpha blending.
484
+ * @realm client
485
+ * @source https://wiki.facepunch.com/gmod/render.GetBlend
486
+ */
487
+ GetBlend(): number;
488
+ }
489
+
490
+ interface RenderLib {
491
+ /**
492
+ * **INTERNAL**: You can use [Global.GetRenderTargetEx](https://wiki.facepunch.com/gmod/Global.GetRenderTargetEx) if you need to create a Render Target
493
+ *
494
+ * Returns the Render Target texture that is used internally for the [Bloom](https://wiki.facepunch.com/gmod/Global.DrawBloom) [Post Processing](https://wiki.facepunch.com/gmod/Post-Processing_Materials) effect.
495
+ *
496
+ * @realm client
497
+ * @source https://wiki.facepunch.com/gmod/render.GetBloomTex0
498
+ */
499
+ GetBloomTex0(): ITexture;
500
+ }
501
+
502
+ interface RenderLib {
503
+ /**
504
+ * **INTERNAL**: You probably want to just use a custom render target. See [Global.GetRenderTargetEx](https://wiki.facepunch.com/gmod/Global.GetRenderTargetEx).
505
+ *
506
+ *
507
+ * Returns the Render Target texture used internally for the [Blur](https://wiki.facepunch.com/gmod/render.BlurRenderTarget) [Post Processing](https://wiki.facepunch.com/gmod/Post-Processing_Materials) effect.
508
+ *
509
+ * Despite its name, this function is not used for the [Bloom](https://wiki.facepunch.com/gmod/Global.DrawBloom) effect.
510
+ *
511
+ * @realm client
512
+ * @source https://wiki.facepunch.com/gmod/render.GetBloomTex1
513
+ */
514
+ GetBloomTex1(): ITexture;
515
+ }
516
+
517
+ interface RenderLib {
518
+ /**
519
+ * Returns the current color modulation values as normals.
520
+ * @realm client
521
+ * @source https://wiki.facepunch.com/gmod/render.GetColorModulation
522
+ */
523
+ GetColorModulation(): (number, number, number);
524
+ }
525
+
526
+ interface RenderLib {
527
+ /**
528
+ * Returns the maximum available directX version.
529
+ * @realm client and menu
530
+ * @source https://wiki.facepunch.com/gmod/render.GetDXLevel
531
+ */
532
+ GetDXLevel(): number;
533
+ }
534
+
535
+ interface RenderLib {
536
+ /**
537
+ * Returns the current fog color.
538
+ * @realm client
539
+ * @source https://wiki.facepunch.com/gmod/render.GetFogColor
540
+ */
541
+ GetFogColor(): (number, number, number);
542
+ }
543
+
544
+ interface RenderLib {
545
+ /**
546
+ * Returns the fog start and end distance.
547
+ * @realm client
548
+ * @source https://wiki.facepunch.com/gmod/render.GetFogDistances
549
+ */
550
+ GetFogDistances(): (number, number, number);
551
+ }
552
+
553
+ interface RenderLib {
554
+ /**
555
+ * Get the maximum density of the fog.
556
+ * @realm client
557
+ * @source https://wiki.facepunch.com/gmod/render.GetFogMaxDensity
558
+ */
559
+ GetFogMaxDensity(): number;
560
+ }
561
+
562
+ interface RenderLib {
563
+ /**
564
+ * Returns the current fog mode.
565
+ *
566
+ * @realm client
567
+ * @source https://wiki.facepunch.com/gmod/render.GetFogMode
568
+ */
569
+ GetFogMode(): number;
570
+ }
571
+
572
+ interface RenderLib {
573
+ /**
574
+ * Returns the full screen depth texture.
575
+ * @realm client
576
+ * @source https://wiki.facepunch.com/gmod/render.GetFullScreenDepthTexture
577
+ * @deprecated Alias of render.GetPowerOfTwoTexture in practice.
578
+ */
579
+ GetFullScreenDepthTexture(): ITexture;
580
+ }
581
+
582
+ interface RenderLib {
583
+ /**
584
+ * Returns whether HDR is currently enabled or not. This takes into account hardware support, current map and current client settings.
585
+ * @realm client and menu
586
+ * @source https://wiki.facepunch.com/gmod/render.GetHDREnabled
587
+ */
588
+ GetHDREnabled(): boolean;
589
+ }
590
+
591
+ interface RenderLib {
592
+ /**
593
+ * Gets the light exposure on the specified position.
594
+ *
595
+ * This is effectively the same as [render.ComputeLighting](https://wiki.facepunch.com/gmod/render.ComputeLighting) without the `normal` argument provided.
596
+ *
597
+ * @realm client
598
+ * @source https://wiki.facepunch.com/gmod/render.GetLightColor
599
+ * @deprecated Same as render.ComputeLighting without the `normal` argument provided, so just use that
600
+ */
601
+ GetLightColor(position: Vector): Vector;
602
+ }
603
+
604
+ interface RenderLib {
605
+ /**
606
+ * **INTERNAL**: You probably want to just use a custom render target. See [Global.GetRenderTargetEx](https://wiki.facepunch.com/gmod/Global.GetRenderTargetEx).
607
+ *
608
+ *
609
+ * Returns the first render target texture that is used internally for Motion Blur and Frame Blend post processing effects.
610
+ * @realm client
611
+ * @source https://wiki.facepunch.com/gmod/render.GetMoBlurTex0
612
+ */
613
+ GetMoBlurTex0(): ITexture;
614
+ }
615
+
616
+ interface RenderLib {
617
+ /**
618
+ * **INTERNAL**: You probably want to just use a custom render target. See [Global.GetRenderTargetEx](https://wiki.facepunch.com/gmod/Global.GetRenderTargetEx).
619
+ *
620
+ *
621
+ * Returns the second render target texture that is used internally for Motion Blur and Frame Blend post processing effects.
622
+ * @realm client
623
+ * @source https://wiki.facepunch.com/gmod/render.GetMoBlurTex1
624
+ */
625
+ GetMoBlurTex1(): ITexture;
626
+ }
627
+
628
+ interface RenderLib {
629
+ /**
630
+ * **INTERNAL**: You probably want to just use a custom render target. See [Global.GetRenderTargetEx](https://wiki.facepunch.com/gmod/Global.GetRenderTargetEx).
631
+ *
632
+ *
633
+ * Returns the first render target texture that was used internally for Morph post processing effect
634
+ *
635
+ * The post processing effect was removed from the base game at some point during development of Garry's Mod 13, but can still be found as a community mod: https://steamcommunity.com/sharedfiles/filedetails/?id=501088470
636
+ * @realm client
637
+ * @source https://wiki.facepunch.com/gmod/render.GetMorphTex0
638
+ */
639
+ GetMorphTex0(): ITexture;
640
+ }
641
+
642
+ interface RenderLib {
643
+ /**
644
+ * **INTERNAL**: You probably want to just use a custom render target. See [Global.GetRenderTargetEx](https://wiki.facepunch.com/gmod/Global.GetRenderTargetEx).
645
+ *
646
+ *
647
+ * Returns the second render target texture that was used internally for Morph post processing effect.
648
+ *
649
+ * See [render.GetMorphTex0](https://wiki.facepunch.com/gmod/render.GetMorphTex0) for more information..
650
+ *
651
+ * @realm client
652
+ * @source https://wiki.facepunch.com/gmod/render.GetMorphTex1
653
+ */
654
+ GetMorphTex1(): ITexture;
655
+ }
656
+
657
+ interface RenderLib {
658
+ /**
659
+ * Returns the Power Of Two Frame Buffer texture.
660
+ * @realm client
661
+ * @source https://wiki.facepunch.com/gmod/render.GetPowerOfTwoTexture
662
+ */
663
+ GetPowerOfTwoTexture(): ITexture;
664
+ }
665
+
666
+ interface RenderLib {
667
+ /**
668
+ * Alias of [render.GetPowerOfTwoTexture](https://wiki.facepunch.com/gmod/render.GetPowerOfTwoTexture).
669
+ * @realm client
670
+ * @source https://wiki.facepunch.com/gmod/render.GetRefractTexture
671
+ * @deprecated Alias of render.GetPowerOfTwoTexture.
672
+ */
673
+ GetRefractTexture(): ITexture;
674
+ }
675
+
676
+ interface RenderLib {
677
+ /**
678
+ * Returns the currently active render target.
679
+ *
680
+ * Instead of saving the current render target using this function and restoring to it later, it is generally better practice to use [render.PushRenderTarget](https://wiki.facepunch.com/gmod/render.PushRenderTarget) and [render.PopRenderTarget](https://wiki.facepunch.com/gmod/render.PopRenderTarget).
681
+ *
682
+ * @realm client
683
+ * @source https://wiki.facepunch.com/gmod/render.GetRenderTarget
684
+ */
685
+ GetRenderTarget(): ITexture;
686
+ }
687
+
688
+ interface RenderLib {
689
+ /**
690
+ * Returns the `_rt_ResolvedFullFrameDepth` texture for SSAO depth. It will only be updated if [GM:NeedsDepthPass](https://wiki.facepunch.com/gmod/GM:NeedsDepthPass) returns true. Depth is written using the [Shaders/DepthWrite](https://wiki.facepunch.com/gmod/Shaders/DepthWrite) by rendering scene a second time, using [SSAO_DepthPass function](https://github.com/ValveSoftware/source-sdk-2013/blob/11a677c349b149b2f77184dc903e6bb17f8df69b/src/game/client/viewrender.cpp#L5576).
691
+ * @realm client
692
+ * @source https://wiki.facepunch.com/gmod/render.GetResolvedFullFrameDepth
693
+ */
694
+ GetResolvedFullFrameDepth(): ITexture;
695
+ }
696
+
697
+ interface RenderLib {
698
+ /**
699
+ * Obtain an [ITexture](https://wiki.facepunch.com/gmod/ITexture) of the screen. You must call [render.UpdateScreenEffectTexture](https://wiki.facepunch.com/gmod/render.UpdateScreenEffectTexture) in order to update this texture with the currently rendered scene.
700
+ *
701
+ * This texture is mainly used within [GM:RenderScreenspaceEffects](https://wiki.facepunch.com/gmod/GM:RenderScreenspaceEffects).
702
+ *
703
+ * @realm client
704
+ * @source https://wiki.facepunch.com/gmod/render.GetScreenEffectTexture
705
+ */
706
+ GetScreenEffectTexture(textureIndex?: number): ITexture;
707
+ }
708
+
709
+ interface RenderLib {
710
+ /**
711
+ * Returns the first quarter sized frame buffer texture.
712
+ * @realm client
713
+ * @source https://wiki.facepunch.com/gmod/render.GetSmallTex0
714
+ */
715
+ GetSmallTex0(): ITexture;
716
+ }
717
+
718
+ interface RenderLib {
719
+ /**
720
+ * Returns the second quarter sized frame buffer texture.
721
+ * @realm client
722
+ * @source https://wiki.facepunch.com/gmod/render.GetSmallTex1
723
+ */
724
+ GetSmallTex1(): ITexture;
725
+ }
726
+
727
+ interface RenderLib {
728
+ /**
729
+ * Returns a floating point texture (RGBA16161616F format) the same resolution as the screen.
730
+ *
731
+ * **NOTE**: The [gmodscreenspace](https://wiki.facepunch.com/gmod/Shaders/gmodscreenspace) doesn't behave as expected when drawing a floating-point texture to an integer texture (e.g. the default render target). Use an UnlitGeneric material instead
732
+ *
733
+ *
734
+ * @realm client
735
+ * @source https://wiki.facepunch.com/gmod/render.GetSuperFPTex
736
+ */
737
+ GetSuperFPTex(): ITexture;
738
+ }
739
+
740
+ interface RenderLib {
741
+ /**
742
+ * See [render.GetSuperFPTex](https://wiki.facepunch.com/gmod/render.GetSuperFPTex).
743
+ * @realm client
744
+ * @source https://wiki.facepunch.com/gmod/render.GetSuperFPTex2
745
+ */
746
+ GetSuperFPTex2(): ITexture;
747
+ }
748
+
749
+ interface RenderLib {
750
+ /**
751
+ * Performs a render trace and returns the color of the surface hit, this uses a low res version of the texture.
752
+ * @realm client
753
+ * @source https://wiki.facepunch.com/gmod/render.GetSurfaceColor
754
+ */
755
+ GetSurfaceColor(startPos: Vector, endPos: Vector): Vector;
756
+ }
757
+
758
+ interface RenderLib {
759
+ /**
760
+ * Returns a vector representing linear tone mapping scale. See [render.SetToneMappingScaleLinear](https://wiki.facepunch.com/gmod/render.SetToneMappingScaleLinear) for details.
761
+ * @realm client
762
+ * @source https://wiki.facepunch.com/gmod/render.GetToneMappingScaleLinear
763
+ */
764
+ GetToneMappingScaleLinear(): Vector;
765
+ }
766
+
767
+ interface RenderLib {
768
+ /**
769
+ * Returns the current view setup.
770
+ * @realm client
771
+ * @source https://wiki.facepunch.com/gmod/render.GetViewSetup
772
+ */
773
+ GetViewSetup(noPlayer?: boolean): table;
774
+ }
775
+
776
+ interface RenderLib {
777
+ /**
778
+ * Lets you know when a screenshot is being taken during rendering hooks.
779
+ *
780
+ * This is useful to hide certain visual elements from screenshots, such as debug overlays, helper objects, etc.
781
+ *
782
+ * @realm client
783
+ * @source https://wiki.facepunch.com/gmod/render.IsTakingScreenshot
784
+ */
785
+ IsTakingScreenshot(): boolean;
786
+ }
787
+
788
+ interface RenderLib {
789
+ /**
790
+ * Sets the render material override for all next calls of [Entity:DrawModel](https://wiki.facepunch.com/gmod/Entity:DrawModel). Also overrides [render.MaterialOverrideByIndex](https://wiki.facepunch.com/gmod/render.MaterialOverrideByIndex).
791
+ *
792
+ * See [render.WorldMaterialOverride](https://wiki.facepunch.com/gmod/render.WorldMaterialOverride), [render.BrushMaterialOverride](https://wiki.facepunch.com/gmod/render.BrushMaterialOverride) and [render.ModelMaterialOverride](https://wiki.facepunch.com/gmod/render.ModelMaterialOverride) for similar functions.
793
+ *
794
+ * **WARNING**: In certain scenarios such as during entity's shadow pass, using this function can cause unexpected side effects. See example below on how to deal with this.
795
+ *
796
+ *
797
+ * @realm client
798
+ * @source https://wiki.facepunch.com/gmod/render.MaterialOverride
799
+ */
800
+ MaterialOverride(material?: IMaterial | nil): void;
801
+ }
802
+
803
+ interface RenderLib {
804
+ /**
805
+ * Similar to [render.MaterialOverride](https://wiki.facepunch.com/gmod/render.MaterialOverride), but overrides the materials per index. For simple entities you may want to just use [Entity:SetSubMaterial](https://wiki.facepunch.com/gmod/Entity:SetSubMaterial).
806
+ *
807
+ * [render.MaterialOverride](https://wiki.facepunch.com/gmod/render.MaterialOverride) overrides effects of this function.
808
+ *
809
+ * @realm client
810
+ * @source https://wiki.facepunch.com/gmod/render.MaterialOverrideByIndex
811
+ */
812
+ MaterialOverrideByIndex(index?: number, material?: IMaterial): void;
813
+ }
814
+
815
+ interface RenderLib {
816
+ /**
817
+ * Returns the maximum texture height the renderer can handle.
818
+ * @realm client and menu
819
+ * @source https://wiki.facepunch.com/gmod/render.MaxTextureHeight
820
+ */
821
+ MaxTextureHeight(): number;
822
+ }
823
+
824
+ interface RenderLib {
825
+ /**
826
+ * Returns the maximum texture width the renderer can handle.
827
+ * @realm client and menu
828
+ * @source https://wiki.facepunch.com/gmod/render.MaxTextureWidth
829
+ */
830
+ MaxTextureWidth(): number;
831
+ }
832
+
833
+ interface RenderLib {
834
+ /**
835
+ * Creates a new [Global.ClientsideModel](https://wiki.facepunch.com/gmod/Global.ClientsideModel), renders it at the specified pos/ang, and removes it. Can also be given an existing [CSEnt](https://wiki.facepunch.com/gmod/CSEnt) to reuse instead.
836
+ *
837
+ * **NOTE**: This function is only meant to be used in a single render pass kind of scenario, if you need to render a model continuously, use a cached [Global.ClientsideModel](https://wiki.facepunch.com/gmod/Global.ClientsideModel) and provide it as a second argument.
838
+ *
839
+ *
840
+ * Using this with a map model ([game.GetWorld](https://wiki.facepunch.com/gmod/game.GetWorld)():[GetModel](https://wiki.facepunch.com/gmod/Entity:GetModel)()) crashes the game.
841
+ *
842
+ * @realm client
843
+ * @source https://wiki.facepunch.com/gmod/render.Model
844
+ */
845
+ Model(settings: table, ent?: CSEnt): void;
846
+ }
847
+
848
+ interface RenderLib {
849
+ /**
850
+ * Forces all future draw operations to use a specific [IMaterial](https://wiki.facepunch.com/gmod/IMaterial).
851
+ *
852
+ * Because this is independent of a specific [Entity](https://wiki.facepunch.com/gmod/Entity), it can be used to change materials on static models that are part of maps.
853
+ *
854
+ * **WARNING**: In certain scenarios such as during entity's shadow pass, using this function can cause unexpected side effects. See example on [render.MaterialOverride](https://wiki.facepunch.com/gmod/render.MaterialOverride) about dealing with this.
855
+ *
856
+ *
857
+ * @realm client
858
+ * @source https://wiki.facepunch.com/gmod/render.ModelMaterialOverride
859
+ */
860
+ ModelMaterialOverride(material?: IMaterial): void;
861
+ }
862
+
863
+ interface RenderLib {
864
+ /**
865
+ * Overrides the write behaviour of all next rendering operations towards the alpha channel of the current render target.
866
+ *
867
+ * See also [render.OverrideBlend](https://wiki.facepunch.com/gmod/render.OverrideBlend).
868
+ *
869
+ * **NOTE**: Doing [surface](https://wiki.facepunch.com/gmod/surface) draw calls with alpha set to 0 is a no-op and will never have any effect.
870
+ *
871
+ *
872
+ * @realm client and menu
873
+ * @source https://wiki.facepunch.com/gmod/render.OverrideAlphaWriteEnable
874
+ */
875
+ OverrideAlphaWriteEnable(enable: boolean, shouldWrite?: boolean): void;
876
+ }
877
+
878
+ interface RenderLib {
879
+ /**
880
+ * Overrides the way that the final color and alpha is calculated for each pixel affected by upcoming draw operations.
881
+ *
882
+ * When a draw operation is performed, the rendering system examines each pixel that is affected by the draw operation and determines its new color by combining (or "Blending") the pixel's current color (Called the "Destination" or "Dst" color) with the new color produced by the draw operation (Called the "Source" or "Src" color.)
883
+ *
884
+ * This function allows you to control the way that those two colors (The Source and Destination) are combined to produce the final pixel color.
885
+ *
886
+ * It's important to know that while [Colors](https://wiki.facepunch.com/gmod/Global.Color) use values in the range `(0-255)`, the color and alpha values used here are normalized to the range `(0-1)` so that they can be multiplied together to produce a value that is still in the range `(0-1)`.
887
+ *
888
+ *
889
+ * @realm client and menu
890
+ * @source https://wiki.facepunch.com/gmod/render.OverrideBlend
891
+ */
892
+ OverrideBlend(enabled: boolean, sourceMultiplier: BLEND, destinationMultiplier: BLEND, blendingFunction: BLENDFUNC): void;
893
+ }
894
+
895
+ interface RenderLib {
896
+ OverrideBlend(enabled: boolean, sourceColorMultiplier: BLEND, destinationColorMultiplier: BLEND, colorBlendingFunction: BLENDFUNC, sourceAlphaMultiplier?: BLEND, destinationAlphaMultiplier?: BLEND, alphaBlendingFunction?: BLENDFUNC): void;
897
+ }
898
+
899
+ interface RenderLib {
900
+ OverrideBlend(enabled: boolean): void;
901
+ }
902
+
903
+ interface RenderLib {
904
+ /**
905
+ * Overrides the internal graphical functions used to determine the final color and alpha of a rendered texture.
906
+ *
907
+ * See also [render.OverrideAlphaWriteEnable](https://wiki.facepunch.com/gmod/render.OverrideAlphaWriteEnable).
908
+ *
909
+ * **NOTE**: Doing [surface](https://wiki.facepunch.com/gmod/surface) draw calls with alpha set to 0 is a no-op and will never have any effect.
910
+ *
911
+ *
912
+ * @realm client and menu
913
+ * @source https://wiki.facepunch.com/gmod/render.OverrideBlendFunc
914
+ * @deprecated Use render.OverrideBlend instead.
915
+ */
916
+ OverrideBlendFunc(enabled: boolean, srcBlend: number, destBlend: number, srcBlendAlpha?: number, destBlendAlpha?: number): void;
917
+ }
918
+
919
+ interface RenderLib {
920
+ /**
921
+ * Overrides the write behaviour of all next rendering operations towards the color channel of the current render target.
922
+ * @realm client and menu
923
+ * @source https://wiki.facepunch.com/gmod/render.OverrideColorWriteEnable
924
+ */
925
+ OverrideColorWriteEnable(enable: boolean, shouldWrite: boolean): void;
926
+ }
927
+
928
+ interface RenderLib {
929
+ /**
930
+ * Overrides the write behaviour of all next rendering operations towards the depth buffer.
931
+ * @realm client and menu
932
+ * @source https://wiki.facepunch.com/gmod/render.OverrideDepthEnable
933
+ */
934
+ OverrideDepthEnable(enable: boolean, shouldWrite: boolean): void;
935
+ }
936
+
937
+ interface RenderLib {
938
+ /**
939
+ * Performs a Stencil operation on every pixel in the active [Render Target](https://wiki.facepunch.com/gmod/render_rendertargets) without performing a draw operation.
940
+ *
941
+ * For more detailed information on the Stencil system, including usage examples, see the [Stencils Render Reference](https://wiki.facepunch.com/gmod/render_stencils) page.
942
+ *
943
+ * @realm client and menu
944
+ * @source https://wiki.facepunch.com/gmod/render.PerformFullScreenStencilOperation
945
+ */
946
+ PerformFullScreenStencilOperation(): void;
947
+ }
948
+
949
+ interface RenderLib {
950
+ /**
951
+ * Removes the current active clipping plane from the clip plane stack.
952
+ * @realm client and menu
953
+ * @source https://wiki.facepunch.com/gmod/render.PopCustomClipPlane
954
+ */
955
+ PopCustomClipPlane(): void;
956
+ }
957
+
958
+ interface RenderLib {
959
+ /**
960
+ * Pops (Removes) the texture filter most recently pushed (Added) onto the magnification texture filter stack.
961
+ *
962
+ * This function should only be called *after* a magnification filter has been pushed via [render.PushFilterMag](https://wiki.facepunch.com/gmod/render.PushFilterMag).
963
+ *
964
+ * For more detailed information and a usage example, see [the texture minification and magnification render reference.](https://wiki.facepunch.com/gmod/render_min_mag_filters)
965
+ *
966
+ * @realm client and menu
967
+ * @source https://wiki.facepunch.com/gmod/render.PopFilterMag
968
+ */
969
+ PopFilterMag(): void;
970
+ }
971
+
972
+ interface RenderLib {
973
+ /**
974
+ * Pops (Removes) the texture filter most recently pushed (Added) onto the minification texture filter stack.
975
+ *
976
+ * This function should only be called *after* a minification filter has been pushed via [render.PushFilterMin()](https://wiki.facepunch.com/gmod/render.PushFilterMin).
977
+ *
978
+ * For more detailed information and a usage example, see [the texture minification and magnification render reference.](https://wiki.facepunch.com/gmod/render_min_mag_filters)
979
+ *
980
+ * @realm client and menu
981
+ * @source https://wiki.facepunch.com/gmod/render.PopFilterMin
982
+ */
983
+ PopFilterMin(): void;
984
+ }
985
+
986
+ interface RenderLib {
987
+ /**
988
+ * Pops the current flashlight mode from the flashlight mode stack.
989
+ * @realm client
990
+ * @source https://wiki.facepunch.com/gmod/render.PopFlashlightMode
991
+ */
992
+ PopFlashlightMode(): void;
993
+ }
994
+
995
+ interface RenderLib {
996
+ /**
997
+ * Pops the last render target and viewport from the RT stack and sets them as the current render target and viewport.
998
+ *
999
+ * This is should be called to restore the previous render target and viewport after a call to [render.PushRenderTarget](https://wiki.facepunch.com/gmod/render.PushRenderTarget).
1000
+ *
1001
+ * @realm client
1002
+ * @source https://wiki.facepunch.com/gmod/render.PopRenderTarget
1003
+ */
1004
+ PopRenderTarget(): void;
1005
+ }
1006
+
1007
+ interface RenderLib {
1008
+ /**
1009
+ * Pushes a new clipping plane of the clip plane stack and sets it as active.
1010
+ *
1011
+ * A max of 2 clip planes are supported on Linux/POSIX, and 6 on Windows.
1012
+ *
1013
+ * @realm client and menu
1014
+ * @source https://wiki.facepunch.com/gmod/render.PushCustomClipPlane
1015
+ */
1016
+ PushCustomClipPlane(normal: Vector, distance: number): void;
1017
+ }
1018
+
1019
+ interface RenderLib {
1020
+ /**
1021
+ * Pushes (Adds) a texture filter onto the magnification texture filter stack.
1022
+ * This will modify how textures are stretched to sizes larger than their native resolution for upcoming rendering and drawing operations.
1023
+ * For a version of this same function that modifies filtering for texture sizes smaller than their native resolution, see [render.PushFilterMin](https://wiki.facepunch.com/gmod/render.PushFilterMin)
1024
+ *
1025
+ * Always be sure to call [render.PopFilterMag](https://wiki.facepunch.com/gmod/render.PopFilterMag) afterwards to avoid texture filtering problems.
1026
+ *
1027
+ * For more detailed information and a usage example, see [the texture minification and magnification render reference.](https://wiki.facepunch.com/gmod/render_min_mag_filters)
1028
+ *
1029
+ * If current texture has more than 1 mipmap, this also sets the mipmap filter.
1030
+ *
1031
+ *
1032
+ * @realm client and menu
1033
+ * @source https://wiki.facepunch.com/gmod/render.PushFilterMag
1034
+ */
1035
+ PushFilterMag(texFilterType: number): void;
1036
+ }
1037
+
1038
+ interface RenderLib {
1039
+ /**
1040
+ * Pushes (Adds) a texture filter onto the minification texture filter stack.
1041
+ * This will modify how textures are compressed to a lower resolution than their native resolution for upcoming rendering and drawing operations.
1042
+ * For a version of this same function that modifies filtering for texture sizes larger than their native resolution, see [render.PushFilterMag()](https://wiki.facepunch.com/gmod/render.PushFilterMag)
1043
+ *
1044
+ * Always be sure to call [render.PopFilterMin()](https://wiki.facepunch.com/gmod/render.PopFilterMin) afterwards to avoid texture filtering problems.
1045
+ *
1046
+ * For more detailed information and a usage example, see [the texture minification and magnification render reference.](https://wiki.facepunch.com/gmod/render_min_mag_filters)
1047
+ *
1048
+ *
1049
+ * @realm client and menu
1050
+ * @source https://wiki.facepunch.com/gmod/render.PushFilterMin
1051
+ */
1052
+ PushFilterMin(texFilterType: number): void;
1053
+ }
1054
+
1055
+ interface RenderLib {
1056
+ /**
1057
+ * Enables the flashlight projection for the upcoming rendering.
1058
+ *
1059
+ *
1060
+ *
1061
+ * @realm client
1062
+ * @source https://wiki.facepunch.com/gmod/render.PushFlashlightMode
1063
+ * @deprecated This will leave models lit under specific conditions. You should use render.RenderFlashlights which is meant as a direct replacement for this function.
1064
+ */
1065
+ PushFlashlightMode(enable?: boolean): void;
1066
+ }
1067
+
1068
+ interface RenderLib {
1069
+ /**
1070
+ * Pushes the current render target and viewport to the RT stack then sets a new current render target and viewport. If the viewport is not specified, the dimensions of the render target are used instead.
1071
+ *
1072
+ * This is similar to a call to [render.SetRenderTarget](https://wiki.facepunch.com/gmod/render.SetRenderTarget) and [render.SetViewPort](https://wiki.facepunch.com/gmod/render.SetViewPort) where the current render target and viewport have been saved beforehand, except the viewport isn't clipped to screen bounds.
1073
+ *
1074
+ * See also [render.PopRenderTarget](https://wiki.facepunch.com/gmod/render.PopRenderTarget).
1075
+ *
1076
+ * **NOTE**: If you want to render to the render target in 2d mode and it is not the same size as the screen, use [cam.Start2D](https://wiki.facepunch.com/gmod/cam.Start2D) and [cam.End2D](https://wiki.facepunch.com/gmod/cam.End2D).
1077
+ *
1078
+ * **NOTE**: If the render target is bigger than the screen, rendering done with the surface library will be clipped to the screen bounds unless you call [Global.DisableClipping](https://wiki.facepunch.com/gmod/Global.DisableClipping)
1079
+ *
1080
+ *
1081
+ * @realm client
1082
+ * @source https://wiki.facepunch.com/gmod/render.PushRenderTarget
1083
+ */
1084
+ PushRenderTarget(texture?: ITexture, x?: number, y?: number, w?: number, h?: number): void;
1085
+ }
1086
+
1087
+ interface RenderLib {
1088
+ /**
1089
+ * Reads the color of the specified pixel from the RenderTarget sent by [render.CapturePixels](https://wiki.facepunch.com/gmod/render.CapturePixels)
1090
+ * @realm client
1091
+ * @source https://wiki.facepunch.com/gmod/render.ReadPixel
1092
+ */
1093
+ ReadPixel(x: number, y: number): (number, number, number, number);
1094
+ }
1095
+
1096
+ interface RenderLib {
1097
+ /**
1098
+ * This applies the changes made to map lighting using [engine.LightStyle](https://wiki.facepunch.com/gmod/engine.LightStyle).
1099
+ * @realm client
1100
+ * @source https://wiki.facepunch.com/gmod/render.RedownloadAllLightmaps
1101
+ */
1102
+ RedownloadAllLightmaps(DoStaticProps?: boolean, UpdateStaticLighting?: boolean): void;
1103
+ }
1104
+
1105
+ interface RenderLib {
1106
+ /**
1107
+ * Renders additive flashlights on an [IMesh](https://wiki.facepunch.com/gmod/IMesh), a direct replacement for [render.PushFlashlightMode](https://wiki.facepunch.com/gmod/render.PushFlashlightMode).
1108
+ * @realm client
1109
+ * @source https://wiki.facepunch.com/gmod/render.RenderFlashlights
1110
+ */
1111
+ RenderFlashlights(renderFunc: function): void;
1112
+ }
1113
+
1114
+ interface RenderLib {
1115
+ /**
1116
+ * Renders the HUD on the screen.
1117
+ * @realm client
1118
+ * @source https://wiki.facepunch.com/gmod/render.RenderHUD
1119
+ */
1120
+ RenderHUD(x: number, y: number, w: number, h: number): void;
1121
+ }
1122
+
1123
+ interface RenderLib {
1124
+ /**
1125
+ * Renders the scene with the specified viewData to the current active render target.
1126
+ *
1127
+ * Static props and LODs are rendered improperly due to incorrectly perceived distance.
1128
+ * Using render.RenderView on a RenderTarget texture in a 3d context like SWEP:PostDrawViewModel() while drawing the RenderTarget texture causes screen flickers.
1129
+ *
1130
+ * @realm client
1131
+ * @source https://wiki.facepunch.com/gmod/render.RenderView
1132
+ */
1133
+ RenderView(view?: ViewData): void;
1134
+ }
1135
+
1136
+ interface RenderLib {
1137
+ /**
1138
+ * Resets the model lighting to the specified color.
1139
+ *
1140
+ * Calls [render.SetModelLighting](https://wiki.facepunch.com/gmod/render.SetModelLighting) for every direction with given color.
1141
+ *
1142
+ * @realm client
1143
+ * @source https://wiki.facepunch.com/gmod/render.ResetModelLighting
1144
+ */
1145
+ ResetModelLighting(r: number, g: number, b: number): void;
1146
+ }
1147
+
1148
+ interface RenderLib {
1149
+ /**
1150
+ * Resets the HDR tone multiplier to the specified value.
1151
+ *
1152
+ * This will only work on HDR maps, and the value will automatically fade to what it was ( or whatever [render.SetGoalToneMappingScale](https://wiki.facepunch.com/gmod/render.SetGoalToneMappingScale) is ) if called only once.
1153
+ *
1154
+ * @realm client
1155
+ * @source https://wiki.facepunch.com/gmod/render.ResetToneMappingScale
1156
+ */
1157
+ ResetToneMappingScale(scale: number): void;
1158
+ }
1159
+
1160
+ interface RenderLib {
1161
+ /**
1162
+ * Sets the ambient lighting for any upcoming render operation.
1163
+ * @realm client
1164
+ * @source https://wiki.facepunch.com/gmod/render.SetAmbientLight
1165
+ */
1166
+ SetAmbientLight(r: number, g: number, b: number): void;
1167
+ }
1168
+
1169
+ interface RenderLib {
1170
+ /**
1171
+ * Sets the alpha blending (or transparency) for upcoming render operations.
1172
+ *
1173
+ * See [render.SetColorModulation](https://wiki.facepunch.com/gmod/render.SetColorModulation) for the function to affect RGB color channels.
1174
+ *
1175
+ * By itself, this will cause visible overlapping on parts of a model that are in front of other parts of the same model.
1176
+ * For a solution to this, see the examples below.
1177
+ *
1178
+ * This does not affect non-model `render.Draw*` functions.
1179
+ * **NOTE**: If a material has the [$alphatest](https://developer.valvesoftware.com/wiki/$alphatest) flag enabled then this function might not behave as expected because alpha will be binary, this has a default cutoff of `0.7`.
1180
+ *
1181
+ *
1182
+ * @realm client
1183
+ * @source https://wiki.facepunch.com/gmod/render.SetBlend
1184
+ */
1185
+ SetBlend(blending: number): void;
1186
+ }
1187
+
1188
+ interface RenderLib {
1189
+ /**
1190
+ * Sets the current drawing material to "color".
1191
+ *
1192
+ * The material is defined as:
1193
+ * ```
1194
+ *
1195
+ * "UnlitGeneric"
1196
+ * {
1197
+ * "$basetexture" "color/white"
1198
+ * "$model" 1
1199
+ * "$translucent" 1
1200
+ * "$vertexalpha" 1
1201
+ * "$vertexcolor" 1
1202
+ * }
1203
+ * ```
1204
+ *
1205
+ *
1206
+ * @realm client
1207
+ * @source https://wiki.facepunch.com/gmod/render.SetColorMaterial
1208
+ */
1209
+ SetColorMaterial(): void;
1210
+ }
1211
+
1212
+ interface RenderLib {
1213
+ /**
1214
+ * Sets the current drawing material to `color_ignorez`.
1215
+ *
1216
+ * The material is defined as:
1217
+ * ```
1218
+ *
1219
+ * "UnlitGeneric"
1220
+ * {
1221
+ * "$basetexture" "color/white"
1222
+ * "$model" 1
1223
+ * "$translucent" 1
1224
+ * "$vertexalpha" 1
1225
+ * "$vertexcolor" 1
1226
+ * "$ignorez" 1
1227
+ * }
1228
+ * ```
1229
+ *
1230
+ * @realm client
1231
+ * @source https://wiki.facepunch.com/gmod/render.SetColorMaterialIgnoreZ
1232
+ */
1233
+ SetColorMaterialIgnoreZ(): void;
1234
+ }
1235
+
1236
+ interface RenderLib {
1237
+ /**
1238
+ * Sets the color modulation for upcoming render operations, such as rendering models.
1239
+ *
1240
+ * The values can exceed 1 for stronger effect.
1241
+ *
1242
+ * See [render.SetBlend](https://wiki.facepunch.com/gmod/render.SetBlend) for the function to affect alpha channel.
1243
+ *
1244
+ * @realm client
1245
+ * @source https://wiki.facepunch.com/gmod/render.SetColorModulation
1246
+ */
1247
+ SetColorModulation(r: number, g: number, b: number): void;
1248
+ }
1249
+
1250
+ interface RenderLib {
1251
+ /**
1252
+ * If the [fog mode](https://wiki.facepunch.com/gmod/render.FogMode) is set to [MATERIAL_FOG_LINEAR_BELOW_FOG_Z](https://wiki.facepunch.com/gmod/Enums/MATERIAL_FOG), the fog will only be rendered below the specified height.
1253
+ * @realm client
1254
+ * @source https://wiki.facepunch.com/gmod/render.SetFogZ
1255
+ */
1256
+ SetFogZ(fogZ: number): void;
1257
+ }
1258
+
1259
+ interface RenderLib {
1260
+ /**
1261
+ * Sets the goal HDR tone mapping scale.
1262
+ *
1263
+ * Use this in a rendering/think hook as it is reset every frame.
1264
+ *
1265
+ * @realm client
1266
+ * @source https://wiki.facepunch.com/gmod/render.SetGoalToneMappingScale
1267
+ */
1268
+ SetGoalToneMappingScale(scale: number): void;
1269
+ }
1270
+
1271
+ interface RenderLib {
1272
+ /**
1273
+ * Sets lighting mode when rendering something.
1274
+ *
1275
+ * **NOTE**: **Do not forget to restore the default value** to avoid unexpected behavior, like the world and the HUD/UI being affected.
1276
+ *
1277
+ *
1278
+ * @realm client
1279
+ * @source https://wiki.facepunch.com/gmod/render.SetLightingMode
1280
+ */
1281
+ SetLightingMode(Mode: number): void;
1282
+ }
1283
+
1284
+ interface RenderLib {
1285
+ /**
1286
+ * Sets lighting origin for the current model.
1287
+ *
1288
+ * @realm client
1289
+ * @source https://wiki.facepunch.com/gmod/render.SetLightingOrigin
1290
+ */
1291
+ SetLightingOrigin(lightingOrigin: Vector): void;
1292
+ }
1293
+
1294
+ interface RenderLib {
1295
+ /**
1296
+ * Sets the texture to be used as the lightmap in upcoming rendering operations. This is required when rendering meshes using a material with a lightmapped shader such as `LightmappedGeneric`.
1297
+ *
1298
+ * @realm client
1299
+ * @source https://wiki.facepunch.com/gmod/render.SetLightmapTexture
1300
+ */
1301
+ SetLightmapTexture(tex: ITexture): void;
1302
+ }
1303
+
1304
+ interface RenderLib {
1305
+ /**
1306
+ * Sets up the local lighting for any upcoming render operation. Up to 4 local lights can be defined, with one of three different types (point, directional, spot).
1307
+ *
1308
+ * Disables all local lights if called with no arguments.
1309
+ *
1310
+ * @realm client
1311
+ * @source https://wiki.facepunch.com/gmod/render.SetLocalModelLights
1312
+ */
1313
+ SetLocalModelLights(lights?: LocalLight): void;
1314
+ }
1315
+
1316
+ interface RenderLib {
1317
+ /**
1318
+ * Sets the material to be used in any upcoming render operation using the [render](https://wiki.facepunch.com/gmod/render).
1319
+ *
1320
+ * Not to be confused with [surface.SetMaterial](https://wiki.facepunch.com/gmod/surface.SetMaterial).
1321
+ *
1322
+ * @realm client
1323
+ * @source https://wiki.facepunch.com/gmod/render.SetMaterial
1324
+ */
1325
+ SetMaterial(mat: IMaterial): void;
1326
+ }
1327
+
1328
+ interface RenderLib {
1329
+ /**
1330
+ * Sets up the ambient lighting for any upcoming render operation. Ambient lighting can be seen as a cube enclosing the object to be drawn, each of its faces representing a directional light source that shines towards the object. Thus, there is a total of six different light sources that can be configured separately.
1331
+ *
1332
+ * Light color components are not restricted to a specific range (i.e. 0-255), instead, higher values will result in a brighter light.
1333
+ *
1334
+ * @realm client
1335
+ * @source https://wiki.facepunch.com/gmod/render.SetModelLighting
1336
+ */
1337
+ SetModelLighting(lightDirection: BOX, red: number, green: number, blue: number): void;
1338
+ }
1339
+
1340
+ interface RenderLib {
1341
+ /**
1342
+ * Sets the render target to the specified rt.
1343
+ * @realm client
1344
+ * @source https://wiki.facepunch.com/gmod/render.SetRenderTarget
1345
+ */
1346
+ SetRenderTarget(texture: ITexture): void;
1347
+ }
1348
+
1349
+ interface RenderLib {
1350
+ /**
1351
+ * Sets the render target with the specified index of `COLOR[n]` to the specified rt, allowing you to work with [Multiple Render Targets (MRT)](https://learn.microsoft.com/en-us/windows/win32/direct3d9/multiple-render-targets). Since standard shaders don't use MRT, you might find this useful at [Shaders/screenspace_general](https://wiki.facepunch.com/gmod/Shaders/screenspace_general).
1352
+ * **NOTE**: MRT doesn't work with 2D render functions like [render.DrawScreenQuad](https://wiki.facepunch.com/gmod/render.DrawScreenQuad). Instead, you can render a [render.DrawQuad](https://wiki.facepunch.com/gmod/render.DrawQuad) using [cam.Start2D](https://wiki.facepunch.com/gmod/cam.Start2D).
1353
+ *
1354
+ * **WARNING**: If you try to render with MSAA and set the main RenderTarget with another RenderTarget, nothing will be rendered.
1355
+ *
1356
+ * [Link to Direct3D 9 documentation on MRT](https://learn.microsoft.com/en-us/windows/win32/direct3d9/multiple-render-targets#:~:text=No%20antialiasing%20is%20supported)
1357
+ *
1358
+ * `Multiple render targets have the following restrictions:`
1359
+ * * *No antialiasing is supported.*
1360
+ *
1361
+ *
1362
+ *
1363
+ * @realm client
1364
+ * @source https://wiki.facepunch.com/gmod/render.SetRenderTargetEx
1365
+ */
1366
+ SetRenderTargetEx(rtIndex: number, texture?: ITexture): void;
1367
+ }
1368
+
1369
+ interface RenderLib {
1370
+ /**
1371
+ * Sets a scissoring rectangle which limits the drawing area. (otherwise known as clipping)
1372
+ * @realm client and menu
1373
+ * @source https://wiki.facepunch.com/gmod/render.SetScissorRect
1374
+ */
1375
+ SetScissorRect(startX: number, startY: number, endX: number, endY: number, enable: boolean): void;
1376
+ }
1377
+
1378
+ interface RenderLib {
1379
+ /**
1380
+ * Sets the shadow color.
1381
+ * @realm client
1382
+ * @source https://wiki.facepunch.com/gmod/render.SetShadowColor
1383
+ */
1384
+ SetShadowColor(red: number, green: number, blue: number): void;
1385
+ }
1386
+
1387
+ interface RenderLib {
1388
+ /**
1389
+ * Sets the shadow projection direction.
1390
+ * @realm client
1391
+ * @source https://wiki.facepunch.com/gmod/render.SetShadowDirection
1392
+ */
1393
+ SetShadowDirection(shadowDirections: Vector): void;
1394
+ }
1395
+
1396
+ interface RenderLib {
1397
+ /**
1398
+ * Sets the maximum shadow projection range.
1399
+ * @realm client
1400
+ * @source https://wiki.facepunch.com/gmod/render.SetShadowDistance
1401
+ */
1402
+ SetShadowDistance(shadowDistance: number): void;
1403
+ }
1404
+
1405
+ interface RenderLib {
1406
+ /**
1407
+ * Sets whether all shadow rendering should be disabled.
1408
+ *
1409
+ * Internally sets `r_shadows_gamecontrol` convar, exactly like `shadow_control` does via its `SetShadowsDisabled` input.
1410
+ *
1411
+ * Currently broken due to internal bug. Will be fixed in the next update, as of 15 Sept 2025.
1412
+ *
1413
+ * @realm client
1414
+ * @source https://wiki.facepunch.com/gmod/render.SetShadowsDisabled
1415
+ */
1416
+ SetShadowsDisabled(disable: boolean): void;
1417
+ }
1418
+
1419
+ interface RenderLib {
1420
+ /**
1421
+ * Sets the Compare Function that all pixels affected by a draw operation will have their Stencil Buffer value tested against.
1422
+ *
1423
+ * When not set to a static value like NEVER or ALWAYS, the Stencil Buffer value corresponding to each affected pixel will be compared against the current [Reference Value](https://wiki.facepunch.com/gmod/render.SetStencilReferenceValue).
1424
+ *
1425
+ * Pixels that **Pass** the Compare Function check move on to the Depth Test, which determines if the draw operation will ultimately be allowed to overwrite the pixel's Color Channel, Stencil Buffer, and Depth Buffer values.
1426
+ *
1427
+ * Pixels that **Fail** the Compare Function check have the [Fail Operation](https://wiki.facepunch.com/gmod/render.SetStencilFailOperation) performed on their Stencil Buffer value and do **not** have any of their Render Target layers modified by the draw operation.
1428
+ *
1429
+ * For more detailed information on the Stencil system, including usage examples, see the [Stencils Render Reference](https://wiki.facepunch.com/gmod/render_stencils) page.
1430
+ *
1431
+ * @realm client and menu
1432
+ * @source https://wiki.facepunch.com/gmod/render.SetStencilCompareFunction
1433
+ */
1434
+ SetStencilCompareFunction(compareFunction: STENCILCOMPARISONFUNCTION): void;
1435
+ }
1436
+
1437
+ interface RenderLib {
1438
+ /**
1439
+ * Enables or disables the Stencil system for future draw operations.
1440
+ *
1441
+ * While enabled, all pixels affected by draw operations will have their corresponding values in the active [Render Target's](https://wiki.facepunch.com/gmod/render_rendertargets) Stencil Buffer compared against the current [Reference Value](https://wiki.facepunch.com/gmod/render.SetStencilReferenceValue) and their current Depth Buffer value compared against the depth of the corresponding pixel from the draw operation.
1442
+ * Depending on the outcomes of these comparisons, one of either the [Pass](https://wiki.facepunch.com/gmod/render.SetStencilPassOperation), [Fail](https://wiki.facepunch.com/gmod/render.SetStencilFailOperation), or [Z-Fail](https://wiki.facepunch.com/gmod/render.SetStencilZFailOperation) operations is performed on the pixel's Stencil Buffer value.
1443
+ * A pixel will only be updated in the active [Render Target](https://wiki.facepunch.com/gmod/render_rendertargets) if the [Pass Operation](https://wiki.facepunch.com/gmod/render.SetStencilPassOperation) is performed.
1444
+ *
1445
+ * For more detailed information on the Stencil system, including usage examples, see the [Stencils Render Reference](https://wiki.facepunch.com/gmod/render_stencils) page.
1446
+ *
1447
+ * **NOTE**: The Stencil system's configuration does **not** reset automatically.
1448
+ * To prevent unexpected behavior, always manually ensure that the Stencil system is configured appropriately for your use-case after enabling it.
1449
+ *
1450
+ *
1451
+ *
1452
+ * @realm client and menu
1453
+ * @source https://wiki.facepunch.com/gmod/render.SetStencilEnable
1454
+ */
1455
+ SetStencilEnable(newState: boolean): void;
1456
+ }
1457
+
1458
+ interface RenderLib {
1459
+ /**
1460
+ * Sets the [Stencil Operation](https://wiki.facepunch.com/gmod/Enums/STENCILOPERATION) that will be performed on the Stencil Buffer values of pixels affected by draw operations if the [Compare Function](https://wiki.facepunch.com/gmod/render.SetStencilCompareFunction) did **not** [Pass](https://wiki.facepunch.com/gmod/render.SetStencilPassOperation) the pixel.
1461
+ *
1462
+ * For more detailed information on the Stencil system, including usage examples, see the [Stencils Render Reference](https://wiki.facepunch.com/gmod/render_stencils) page.
1463
+ *
1464
+ * @realm client and menu
1465
+ * @source https://wiki.facepunch.com/gmod/render.SetStencilFailOperation
1466
+ */
1467
+ SetStencilFailOperation(failOperation: STENCILOPERATION): void;
1468
+ }
1469
+
1470
+ interface RenderLib {
1471
+ /**
1472
+ * Sets the [Stencil Operation](https://wiki.facepunch.com/gmod/Enums/STENCILOPERATION) that will be performed on the Stencil Buffer values of pixels affected by draw operations if the [Compare Function](https://wiki.facepunch.com/gmod/render.SetStencilCompareFunction) Passes the pixel.
1473
+ *
1474
+ * For more detailed information on the Stencil system, including usage examples, see the [Stencils Render Reference](https://wiki.facepunch.com/gmod/render_stencils) page.
1475
+ *
1476
+ * @realm client and menu
1477
+ * @source https://wiki.facepunch.com/gmod/render.SetStencilPassOperation
1478
+ */
1479
+ SetStencilPassOperation(passOperation: STENCILOPERATION): void;
1480
+ }
1481
+
1482
+ interface RenderLib {
1483
+ /**
1484
+ * Sets the Stencil system's Reference Value which is compared against each pixel's corresponding Stencil Buffer value in the [Compare Function](https://wiki.facepunch.com/gmod/render.SetStencilCompareFunction) and can be used to modify the Stencil Buffer value of those same pixels in the [Pass](https://wiki.facepunch.com/gmod/render.SetStencilPassOperation), [Fail](https://wiki.facepunch.com/gmod/render.SetStencilFailOperation), and [Z Fail](https://wiki.facepunch.com/gmod/render.SetStencilZFailOperation) operations.
1485
+ *
1486
+ * For more detailed information on the Stencil system, including usage examples, see the [Stencils Render Reference](https://wiki.facepunch.com/gmod/render_stencils) page.
1487
+ *
1488
+ * @realm client and menu
1489
+ * @source https://wiki.facepunch.com/gmod/render.SetStencilReferenceValue
1490
+ */
1491
+ SetStencilReferenceValue(referenceValue: number): void;
1492
+ }
1493
+
1494
+ interface RenderLib {
1495
+ /**
1496
+ * Sets the unsigned 8-bit (`byte`) bitflag mask that will be bitwise ANDed with all values as they are read (tested) from the Stencil Buffer
1497
+ *
1498
+ * This can be considered a "niche" Stencil function as it is not required for many Stencil use-cases.
1499
+ *
1500
+ * This is a companion function to [render.SetStencilWriteMask](https://wiki.facepunch.com/gmod/render.SetStencilWriteMask) which modifies Stencil Buffer values as they are written.
1501
+ *
1502
+ * For more detailed information on the Stencil system, including usage examples, see the [Stencils Render Reference](https://wiki.facepunch.com/gmod/render_stencils) page.
1503
+ *
1504
+ * @realm client and menu
1505
+ * @source https://wiki.facepunch.com/gmod/render.SetStencilTestMask
1506
+ */
1507
+ SetStencilTestMask(bitMask: number): void;
1508
+ }
1509
+
1510
+ interface RenderLib {
1511
+ /**
1512
+ * Sets the unsigned 8-bit (`byte`) bitflag mask that will be bitwise ANDed with all values as they are written to the Stencil Buffer
1513
+ *
1514
+ * This can be considered a "niche" Stencil function as it is not required for many Stencil use-cases.
1515
+ *
1516
+ * This is a companion function to [render.SetStencilTestMask](https://wiki.facepunch.com/gmod/render.SetStencilTestMask) which modifies Stencil Buffer values as they are read.
1517
+ *
1518
+ * For more detailed information on the Stencil system, including usage examples, see the [Stencils Render Reference](https://wiki.facepunch.com/gmod/render_stencils) page.
1519
+ *
1520
+ * @realm client and menu
1521
+ * @source https://wiki.facepunch.com/gmod/render.SetStencilWriteMask
1522
+ */
1523
+ SetStencilWriteMask(bitMask: number): void;
1524
+ }
1525
+
1526
+ interface RenderLib {
1527
+ /**
1528
+ * Sets the [Stencil Operation](https://wiki.facepunch.com/gmod/Enums/STENCILOPERATION) that will be performed on the Stencil Buffer values of pixels affected by draw operations if the [Compare Function](https://wiki.facepunch.com/gmod/render.SetStencilCompareFunction) Passed a given pixel, but it did **not** Pass the Depth Test.
1529
+ *
1530
+ * For more detailed information on the Stencil system, including usage examples, see the [Stencils Render Reference](https://wiki.facepunch.com/gmod/render_stencils) page.
1531
+ *
1532
+ * @realm client and menu
1533
+ * @source https://wiki.facepunch.com/gmod/render.SetStencilZFailOperation
1534
+ */
1535
+ SetStencilZFailOperation(zFailOperation: STENCILOPERATION): void;
1536
+ }
1537
+
1538
+ interface RenderLib {
1539
+ /**
1540
+ * Sets the tone mapping scale for upcoming rendering operations.
1541
+ * @realm client
1542
+ * @source https://wiki.facepunch.com/gmod/render.SetToneMappingScaleLinear
1543
+ */
1544
+ SetToneMappingScaleLinear(scales: Vector): void;
1545
+ }
1546
+
1547
+ interface RenderLib {
1548
+ /**
1549
+ * Changes the view port position and size. The values will be clamped to the game's screen resolution.
1550
+ *
1551
+ * If you are looking to render something to a texture (render target), you should use [render.PushRenderTarget](https://wiki.facepunch.com/gmod/render.PushRenderTarget).
1552
+ *
1553
+ * **NOTE**: This function will override values of [Global.ScrW](https://wiki.facepunch.com/gmod/Global.ScrW) and [Global.ScrH](https://wiki.facepunch.com/gmod/Global.ScrH) with the ones you set.
1554
+ *
1555
+ *
1556
+ * @realm client and menu
1557
+ * @source https://wiki.facepunch.com/gmod/render.SetViewPort
1558
+ */
1559
+ SetViewPort(x: number, y: number, w: number, h: number): void;
1560
+ }
1561
+
1562
+ interface RenderLib {
1563
+ /**
1564
+ * Sets the internal parameter **INT_RENDERPARM_WRITE_DEPTH_TO_DESTALPHA**.
1565
+ * @realm client
1566
+ * @source https://wiki.facepunch.com/gmod/render.SetWriteDepthToDestAlpha
1567
+ */
1568
+ SetWriteDepthToDestAlpha(enable: boolean): void;
1569
+ }
1570
+
1571
+ interface RenderLib {
1572
+ /**
1573
+ * Swaps the frame buffers/cycles the frame. In other words, this updates the screen.
1574
+ *
1575
+ * If you take a really long time during a single frame render, it is a good idea to use this and let the user know that the game isn't stuck.
1576
+ *
1577
+ * @realm client
1578
+ * @source https://wiki.facepunch.com/gmod/render.Spin
1579
+ */
1580
+ Spin(): void;
1581
+ }
1582
+
1583
+ interface RenderLib {
1584
+ /**
1585
+ * Begin drawing a multi-segment Beam.
1586
+ *
1587
+ * For more detailed information on Beams, as well as usage examples, see the [Beams Render Reference](https://wiki.facepunch.com/gmod/render_beams).
1588
+ *
1589
+ *
1590
+ * @realm client
1591
+ * @source https://wiki.facepunch.com/gmod/render.StartBeam
1592
+ */
1593
+ StartBeam(segmentCount: number): void;
1594
+ }
1595
+
1596
+ interface RenderLib {
1597
+ /**
1598
+ * Returns whether the player's hardware supports HDR. (High Dynamic Range) HDR can still be disabled by the `mat_hdr_level` console variable or just not be supported by the map.
1599
+ * @realm client and menu
1600
+ * @source https://wiki.facepunch.com/gmod/render.SupportsHDR
1601
+ */
1602
+ SupportsHDR(): boolean;
1603
+ }
1604
+
1605
+ interface RenderLib {
1606
+ /**
1607
+ * Returns if the current settings and the system allow the usage of pixel shaders 1.4.
1608
+ * @realm client and menu
1609
+ * @source https://wiki.facepunch.com/gmod/render.SupportsPixelShaders_1_4
1610
+ */
1611
+ SupportsPixelShaders_1_4(): boolean;
1612
+ }
1613
+
1614
+ interface RenderLib {
1615
+ /**
1616
+ * Returns if the current settings and the system allow the usage of pixel shaders 2.0.
1617
+ * @realm client and menu
1618
+ * @source https://wiki.facepunch.com/gmod/render.SupportsPixelShaders_2_0
1619
+ */
1620
+ SupportsPixelShaders_2_0(): boolean;
1621
+ }
1622
+
1623
+ interface RenderLib {
1624
+ /**
1625
+ * Returns if the current settings and the system allow the usage of vertex shaders 2.0.
1626
+ * @realm client and menu
1627
+ * @source https://wiki.facepunch.com/gmod/render.SupportsVertexShaders_2_0
1628
+ */
1629
+ SupportsVertexShaders_2_0(): boolean;
1630
+ }
1631
+
1632
+ interface RenderLib {
1633
+ /**
1634
+ * Suppresses or enables any engine lighting for any upcoming render operation.
1635
+ *
1636
+ * This does not affect [IMesh](https://wiki.facepunch.com/gmod/IMesh)es.
1637
+ *
1638
+ * @realm client
1639
+ * @source https://wiki.facepunch.com/gmod/render.SuppressEngineLighting
1640
+ */
1641
+ SuppressEngineLighting(suppressLighting: boolean): void;
1642
+ }
1643
+
1644
+ interface RenderLib {
1645
+ /**
1646
+ * Enables HDR tone mapping which influences the brightness.
1647
+ * @realm client
1648
+ * @source https://wiki.facepunch.com/gmod/render.TurnOnToneMapping
1649
+ */
1650
+ TurnOnToneMapping(): void;
1651
+ }
1652
+
1653
+ interface RenderLib {
1654
+ /**
1655
+ * Updates the texture returned by [render.GetFullScreenDepthTexture](https://wiki.facepunch.com/gmod/render.GetFullScreenDepthTexture).
1656
+ *
1657
+ * Silently fails if [render.SupportsPixelShaders_2_0](https://wiki.facepunch.com/gmod/render.SupportsPixelShaders_2_0) returns false.
1658
+ *
1659
+ * @realm client
1660
+ * @source https://wiki.facepunch.com/gmod/render.UpdateFullScreenDepthTexture
1661
+ */
1662
+ UpdateFullScreenDepthTexture(): void;
1663
+ }
1664
+
1665
+ interface RenderLib {
1666
+ /**
1667
+ * Updates the power of two texture.
1668
+ * @realm client
1669
+ * @source https://wiki.facepunch.com/gmod/render.UpdatePowerOfTwoTexture
1670
+ */
1671
+ UpdatePowerOfTwoTexture(): ITexture;
1672
+ }
1673
+
1674
+ interface RenderLib {
1675
+ /**
1676
+ * Pretty much alias of [render.UpdatePowerOfTwoTexture](https://wiki.facepunch.com/gmod/render.UpdatePowerOfTwoTexture) but does not return the texture.
1677
+ * @realm client
1678
+ * @source https://wiki.facepunch.com/gmod/render.UpdateRefractTexture
1679
+ */
1680
+ UpdateRefractTexture(): void;
1681
+ }
1682
+
1683
+ interface RenderLib {
1684
+ /**
1685
+ * Copies the entire screen to the screen effect texture, which can be acquired via [render.GetScreenEffectTexture](https://wiki.facepunch.com/gmod/render.GetScreenEffectTexture). This function is mainly intended to be used in [GM:RenderScreenspaceEffects](https://wiki.facepunch.com/gmod/GM:RenderScreenspaceEffects).
1686
+ * @realm client
1687
+ * @source https://wiki.facepunch.com/gmod/render.UpdateScreenEffectTexture
1688
+ */
1689
+ UpdateScreenEffectTexture(textureIndex?: number): void;
1690
+ }
1691
+
1692
+ interface RenderLib {
1693
+ /**
1694
+ * This function overrides all map materials for one frame.
1695
+ * @realm client
1696
+ * @source https://wiki.facepunch.com/gmod/render.WorldMaterialOverride
1697
+ */
1698
+ WorldMaterialOverride(mat?: IMaterial): void;
1699
+ }
1700
+