Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ <h4>Custom Vertex Format:</h4>
</ul>
<p>Now, this might look odd as it seems that we can specify more attribute kinds in our vertex format than we can in the vertex shader. However, in the shader <i>Position</i> and <i>3D Position</i> are treated as the <em>same </em>attribute, except that <i>Position</i> is expected to have only &quot;x&quot; and &quot;y&quot; coordinates whereas <i>3D Position</i> has “x”, “y” and “z” coordinates. So how do you map what&#39;s in your vertex format to how you define attributes in your shader? Let&#39;s start by looking at a typical set of attributes from the default shader:</p>
<p> </p>
<p class="code">attribute vec3 in_Position;        // (x,y,z)<br />
<p class="code language-glsl">attribute vec3 in_Position;        // (x,y,z)<br />
//attribute vec3 in_Normal;        // (x,y,z) unused in this shader.<br />
attribute vec4 in_Colour;          // (r,g,b,a)<br />
attribute vec2 in_TextureCoord;    // (u,v)</p>
Expand All @@ -106,7 +106,7 @@ <h4>Custom Vertex Format:</h4>
vertex_format_add_texcoord();<br />
my_format = vertex_format_end();</p>
<p>And now the associated shader attributes:</p>
<p class="code">attribute vec3 in_Position;      // (x,y,z)<br />
<p class="code language-glsl">attribute vec3 in_Position;      // (x,y,z)<br />
attribute vec4 in_Colour0;       // (r,g,b,a)<br />
attribute vec4 in_Colour1;       // (r,g,b,a)<br />
attribute vec2 in_TextureCoord;  // (u,v)</p>
Expand All @@ -120,7 +120,7 @@ <h4>Custom Vertex Format:</h4>
vertex_format_add_texcoord();<br />
my_format = vertex_format_end();</p>
<p>And the shader code would look something like this:</p>
<p class="code">attribute vec3 in_Position;      // (x,y,z)<br />
<p class="code language-glsl">attribute vec3 in_Position;      // (x,y,z)<br />
attribute vec4 in_Colour;        // (r,g,b,a)<br />
attribute vec2 in_myTexcoord;    // (u,v)<br />
attribute vec2 in_TextureCoord;  // (u,v)<br />
Expand All @@ -139,7 +139,7 @@ <h4>Custom Vertex Format:</h4>
<div style="float:right">Next: <a href="Guide_To_Using_Blendmodes.htm">Guide To Using Blendmodes</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2023 All Rights Reserved</span></h5>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2026 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
Primitive Building
Expand Down
160 changes: 80 additions & 80 deletions Manual/contents/Additional_Information/Guide_To_Using_Shaders.htm

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Manual/contents/Content.htm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<meta name="search-keywords" content="" />
<meta name="robots" content="NOODP" />
<script src="assets/scripts/gml.js" type="module"></script>
<script src="assets/scripts/glsl.js" type="module"></script>
<script src="assets/scripts/main_script.js" type="module"></script>
<meta name="description" content="Find the answer to even the most obscure GameMaker questions in the GameMaker Manual, covering everything from rooms and particles to vectors and blend modes." />
<meta property="og:description" content="Find the answer to even the most obscure GameMaker questions in the GameMaker Manual, covering everything from rooms and particles to vectors and blend modes." />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>audio_emitter_free</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../../../assets/css/default.css" type="text/css" />
<script src="../../../../../assets/scripts/main_script.js" type="module"></script>
<meta name="rh-authors" content="Mark Alexander" />
Expand All @@ -15,7 +15,9 @@
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1><span data-field="title" data-format="default">audio_emitter_free</span></h1>
<p>With this function you can remove the given emitter from memory. This should always be done whenever the emitter is not going to be used further in the room or the game, ie: in the <a href="../../../../../The_Asset_Editors/Object_Properties/Object_Events.htm">Destroy Event</a> of the instance or in the <a href="../../../../../The_Asset_Editors/Object_Properties/Other_Events.htm">Room End Event</a>, otherwise you may end up with a memory leak that will slow down and eventually crash your game.</p>
<p>With this function you can remove the given emitter from memory. This should always be done whenever the emitter is not going to be used further in the room or the game, i.e.: in the <a href="../../../../../The_Asset_Editors/Object_Properties/Object_Events.htm">Clean Up Event</a> of the instance or in the <a href="../../../../../The_Asset_Editors/Object_Properties/Other_Events.htm">Room End Event</a>, otherwise you may end up with a memory leak that will slow down and eventually crash your game.</p>
<p>Sound instances currently being played on the emitter are force-stopped.</p>
<div data-conref="../../../../../assets/snippets/Note_Function_Triggers_Audio_Playback_Ended.hts"> </div>
<p> </p>
<h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">audio_emitter_free</span>(emitter)</p>
Expand All @@ -28,7 +30,7 @@ <h4>Syntax:</h4>
</tr>
<tr>
<td>emitter</td>
<td><span data-keyref="Type_ID_Audio_Emitter">Audio Emitter ID</span></td>
<td><span data-keyref="Type_ID_Audio_Emitter"><a href="audio_emitter_create.htm" target="_blank">Audio Emitter ID</a></span></td>
<td>The index of the emitter to free.</td>
</tr>
</tbody>
Expand All @@ -38,12 +40,12 @@ <h4>Returns:</h4>
<p class="code"><span data-keyref="Type_Void">N/A</span></p>
<p> </p>
<h4>Example:</h4>
<p class="code">if (lives == 0) <br />
<p class="code">if (lives == 0)<br />
{<br />
    audio_emitter_free(s_emit);<br />
    room_goto(rm_Menu);<br />
    room_goto(rm_menu);<br />
}</p>
<p>The above code checks the value of the global variable &quot;lives&quot; and if it returns 0, it will destroy the emitter indexed in the variable &quot;s_emit&quot; and then go to the room indexed in the variable &quot;rm_Menu&quot;.</p>
<p>The above code checks the value of the global variable &quot;lives&quot; and if it returns 0, it will destroy the emitter indexed in the variable &quot;s_emit&quot; and then go to the room indexed in the variable &quot;rm_menu&quot;.</p>
<p> </p>
<p> </p>
<p> </p>
Expand All @@ -54,7 +56,7 @@ <h4>Example:</h4>
<div style="float:right">Next: <a href="audio_play_sound_on.htm">audio_play_sound_on</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2022 All Rights Reserved</span></h5>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2026 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
audio_emitter_free
Expand Down
Loading