Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarifications to WebGL limitations, INI open & close behaviour, draw targets, reserved shader function names and others #227

Merged
merged 17 commits into from
Dec 20, 2024
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
efc00c7
docs(general): "Clear Display Buffer" is not working
YYBartT Dec 6, 2024
fbdd656
Merge branch 'develop.bart-temp' into develop.bart
YYBartT Dec 6, 2024
a32298f
Merge branch 'develop' into develop.bart
YYBartT Dec 6, 2024
22fa8db
docs(general): string inconsistent braces handling between runtime an…
YYBartT Dec 6, 2024
dfa1799
docs(feature): documented debug input functions
YYBartT Dec 6, 2024
b964ae5
docs(general): window_mouse_get_locked() page has a typo in hyperlink…
YYBartT Dec 9, 2024
87bbb5e
docs(general): ini_close() and ini_open() pages do not document curre…
YYBartT Dec 10, 2024
c4d18fa
docs(general): surface_reset_target() page wording could be made more…
YYBartT Dec 10, 2024
e06e6ae
docs(general): minor changes to Shaders page
YYBartT Dec 11, 2024
bbb21b9
docs(general): capitalised Draw event
YYBartT Dec 11, 2024
f4c50da
docs(general): surface_reset_target() page wording could be made more…
YYBartT Dec 12, 2024
2fa77a8
docs(general): surface_reset_target() page wording could be made more…
YYBartT Dec 13, 2024
21ce4be
docs(general): Small changes to webgl_enabled manual page
YYBartT Dec 16, 2024
d2e88dc
docs(general): Minor changes to layer_shader manual page
YYBartT Dec 16, 2024
7cafe1e
docs(general): Several shader functions are not defined in autocomple…
YYBartT Dec 16, 2024
b883425
docs(general): gl_FragData problem and shader not working when having…
YYBartT Dec 17, 2024
547168a
docs(general): Minor fixes to PR #227
gurpreetsinghmatharoo Dec 20, 2024
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
Prev Previous commit
Next Next commit
docs(general): Minor changes to layer_shader manual page
YYBartT committed Dec 16, 2024
commit d2e88dc5118e0219005558e711d4576b25039693
Original file line number Diff line number Diff line change
@@ -1,67 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>layer_shader</title>
<meta name="generator" content="Adobe RoboHelp 2020"/>
<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"/>
<meta name="topic-comment" content="Page outlining the function layer_shader"/>
<meta name="rh-index-keywords" content="layer_shader"/>
<meta name="search-keywords" content="layer_shader"/>
</head>
<body><!--<div class="body-scroll" style="top: 150px;">-->
<h1><span data-field="title" data-format="default">layer_shader</span></h1>
<p>This function assigns a shader resource to any given layer and the layer will then be rendered using that shader.</p>
<p>You supply either The handle of the layer or the name of the layer (as a string - this will have a performance impact) , along with the ID of the shader to use. The shader must have been created previously in the Asset Browser and the shader index (the name of the shader resource) is then passed to this function. If the layer assigned has instances added to it, then the shader will be applied to <i>all</i> the draw events that the instance uses - for example if the instance has a Draw GUI Begin event, then the shader will be applied automatically to it. The shader will also affect any other graphic elements drawn on that layer, like sprite assets, tile maps or particle systems.</p>
<p class="note"><span data-conref="../../../../../assets/snippets/Tag_note.hts"> </span> The function is <i>not</i> meant to be called in any draw events or step events, but rather only needs to be called at the start of the room in the <b>Room Creation Code</b> or in the <b>Create Event </b>/ <b>Room Start Event</b> of an instance.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">layer_shader</span>(layer_id, shader)</p>
<table>
<tbody>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>layer_id</td>
<td><span data-keyref="Type_String"><a href="../../../../../../GameMaker_Language/GML_Overview/Data_Types.htm" target="_blank">String</a></span> or <span data-keyref="Type_ID_Layer"><a href="../../../../../../GameMaker_Language/GML_Reference/Asset_Management/Rooms/General_Layer_Functions/layer_get_id.htm" target="_blank">Layer ID</a></span></td>
<td>The handle of the layer to target (or the layer name as a string)</td>
</tr>
<tr>
<td>shader</td>
<td><span data-keyref="Type_Asset_Shader"><a href="../../../../../../The_Asset_Editors/Shaders.htm" target="_blank">Shader Asset</a></span></td>
<td>The shader index to assign to the layer</td>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns:</h4>
<p class="code"><span data-keyref="Type_Void">N/A</span></p>
<p> </p>
<h4>Example:</h4>
<p class="code">var lay_id = layer_get_id(&quot;Instances&quot;);
<br/>
<span data-field="title" data-format="default">layer_shader</span>(lay_id, shd_Sepia); </p>
<p>The above code will assign the shader resource <span class="inline2">shd_Sepia</span> to the given layer for all drawing.</p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a data-xref="{title}" href="General_Layer_Functions.htm">General Layer Functions</a></div>
<div style="float:right">Next: <a data-xref="{title}" href="layer_get_script_begin.htm">layer_get_script_begin</a></div>
</div>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>layer_shader</title>
<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" />
<meta name="topic-comment" content="Page outlining the function layer_shader" />
<meta name="rh-index-keywords" content="layer_shader" />
<meta name="search-keywords" content="layer_shader" />
</head>
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1><span data-field="title" data-format="default">layer_shader</span></h1>
<p>This function assigns a shader asset to any given layer and the layer will then be rendered using that shader.</p>
<p>You supply either the handle of the layer or the name of the layer (as a string - this will have a performance impact) , along with the shader to use. The shader must have been created previously in the Asset Browser and the shader asset is then passed to this function. If the layer assigned has instances added to it, then the shader will be applied to <i>all</i> the draw events that the instance uses - for example if the instance has a Draw GUI Begin event, then the shader will be applied automatically to it. The shader will also affect any other graphic elements drawn on that layer, like sprite assets, tile maps or particle systems.</p>
<p class="note"><span data-conref="../../../../../assets/snippets/Tag_note.hts"> </span> The function is <i>not</i> meant to be called in any Draw events or Step events, but rather only needs to be called at the start of the room in the <b>Room Creation Code</b> or in the <b>Create Event </b>/ <b>Room Start Event</b> of an instance.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">layer_shader</span>(layer_id, shader)</p>
<table>
<tbody>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>layer_id</td>
<td><span data-keyref="Type_String"><a href="../../../../GML_Overview/Data_Types.htm" target="_blank">String</a></span> or <span data-keyref="Type_ID_Layer"><a href="layer_get_id.htm" target="_blank">Layer</a></span></td>
<td>The handle of the layer to target (or the layer name as a string)</td>
</tr>
<tr>
<td>shader</td>
<td><span data-keyref="Type_Asset_Shader"><a href="../../../../../The_Asset_Editors/Shaders.htm" target="_blank">Shader Asset</a></span></td>
<td>The shader to assign to the layer</td>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns:</h4>
<p class="code"><span data-keyref="Type_Void">N/A</span></p>
<p> </p>
<h4>Example:</h4>
<p class="code">var _lay_id = layer_get_id(&quot;Instances&quot;);<br />
<span data-field="title" data-format="default">layer_shader</span>(_lay_id, shd_sepia);
</p>
<p>The above code will assign the shader asset <span class="inline2">shd_sepia</span> to the given layer for all drawing.</p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a data-xref="{title}" href="General_Layer_Functions.htm">Layers</a></div>
<div style="float:right">Next: <a data-xref="{title}" href="layer_get_script_begin.htm">layer_get_script_begin</a></div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2023 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
layer_shader
--><!-- TAGS
-->
<!-- TAGS
layer_shader
--></body>
-->
</body>
</html>