Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jan 24, 2025
2 parents 170abe6 + 38f599f commit 4cf3387
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ <h1><span data-field="title" data-format="default">The Depth And Stencil Buffer<
<h2 id="the_depth_buffer">The Depth Buffer</h2>
<p>The depth buffer, also called z-buffer, is a graphics buffer created with the same dimensions as the surface that it&#39;s created for. It stores a 24-bit depth value for every pixel of the surface, which holds the distance away from the surface.</p>
<p><img class="center" height="412" src="../../../../assets/Images/Scripting_Reference/GML/Reference/Drawing/Surface_Colour_Alpha_and_Depth_Buffer.png" width="1348" /></p>
<p>The depth buffer can be displayed as a grayscale image, where <strong>white</strong> (a value of 1) indicates the pixel is as far away as it can be (at the far plane) and <strong>black</strong> (a value of 0) indicates the closest pixel (at znear).</p>
<p>The depth buffer can be displayed as a grayscale image, where <strong>white</strong> (a value of 1) indicates the pixel is as far away as it can be (at the far plane) and <strong>black</strong> (a value of 0) indicates it is as close as it can be (at znear).</p>
<p>By default, the depth buffer is <strong>enabled</strong> in <span data-keyref="GameMaker Name">GameMaker</span>, which means that every surface is <a href="../Surfaces/surface_create.htm" title="surface_create()">created</a> with a depth buffer. This also applies to the <span class="inline2"><a data-xref="{title}" href="../Surfaces/application_surface.htm">application_surface</a></span>, which is the surface that&#39;s drawn to by default.</p>
<p class="note"><span data-conref="../../../../assets/snippets/Tag_note.hts"> </span> The application surface is only used in the regular Draw events (Draw, Draw Begin and Draw End), in the other Draw events the draw target isn&#39;t set to a surface. You can still make use of the depth and stencil buffer at any time in the other Draw events, however, by creating your own <a href="../Surfaces/Surfaces.htm#custom_surfaces" title="Custom Surfaces">custom surface</a> that has the depth and/or stencil buffer enabled, draw what you need to it and finally draw that surface to the screen.</p>
<h3>Depth vs. Depth Buffer Depth</h3>
<p>There are two different uses of the term depth in <span data-keyref="GameMaker Name">GameMaker</span></p>
<ul class="colour">
Expand All @@ -48,7 +49,7 @@ <h3 id="the_depth_test">The Depth Test</h3>
<p>The depth test is a test using the depth buffer that can be performed on the pixels that you draw to. It is disabled by default and can be enabled with <span class="inline3_func"><a data-xref="{title}" href="../GPU_Control/gpu_set_ztestenable.htm">gpu_set_ztestenable</a></span>.</p>
<p>When enabled, the GPU performs a test on all pixels affected by the current draw command (e.g. a <span class="inline2">draw_*</span> function). This test is set to <span class="inline2"><span data-keyref="Const_ZFunc_Default">cmpfunc_lessequal</span></span> by default, but you can change it to another comparison using <span class="inline3_func"><a data-xref="{title}" href="../GPU_Control/gpu_set_zfunc.htm">gpu_set_zfunc</a></span>.</p>
<p>The test looks as follows: </p>
<p class="code"><span data-keyref="Const_Depth_Equation">depth_of_pixel_being_written cmp_func value_at_pixel_in_depth_buffer</span></p>
<p class="code"><span data-keyref="Const_Depth_Equation">depth_of_pixel_being_written cmp_func value_at_pixel_in_depth_buffer</span></p>
<p>If a pixel passes the depth test, it is passed to the stencil test (when enabled). If all tests pass, the pixel is finally drawn.</p>
<p class="note"><span data-conref="../../../../assets/snippets/Tag_note.hts"> </span> Z-writing must be enabled in order for the depth value to be overwritten if the depth test passes. This is enabled by default. See <span class="inline3_func"><a data-xref="{title}" href="../GPU_Control/gpu_set_zwriteenable.htm">gpu_set_zwriteenable</a></span>.</p>
<p>When z-testing is enabled, every time you draw something to a surface that has a depth buffer, the depth value of the new pixel is compared to the value at the corresponding pixel in the depth buffer. For example: </p>
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>GM_build_date</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"></script>
<meta name="rh-authors" content="Mark Alexander" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?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>GM_runtime_type</title>
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" type="text/css" href="../../../assets/css/default.css" />
<script src="../../../assets/scripts/main_script.js" type="module"></script>
<meta name="rh-authors" content="" />
<meta name="topic-comment" content="" />
<meta name="rh-index-keywords" content="GM_runtime_type" />
<meta name="search-keywords" content="GM_runtime_type" />
<meta name="template" content="assets/masterpages/Manual_Keyword_Page.htt" />
<meta name="condition-tags" content="Export:Beta" />
</head>
<body>
<h1><span data-field="title" data-format="default">GM_runtime_type</span></h1>
<p>This built-in constant holds the type of the runtime: <span class="inline2">&quot;gms2&quot;</span> for the current runtime or <span class="inline2">&quot;gmrt&quot;</span> for the new runtime.</p>
<p class="note"><span data-conref="../../../assets/snippets/Tag_note.hts"> </span> See <a data-xref="{title}" href="../../../Settings/Runner_Details/GMRT_(GameMaker_Runtime).htm">GMRT (GameMaker Runtime)</a> for more information about the new runtime.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">GM_runtime_type</span></p>
<p> </p>
<h4>Holds:</h4>
<p class="code"><span data-keyref="Type_String"><a href="../../GML_Overview/Data_Types.htm" target="_blank">String</a></span></p>
<p> </p>
<h4>Example:</h4>
<p class="code">show_debug_message($&quot;Using runtime: {string_upper(<span data-field="title" data-format="default">GM_runtime_type</span>)}&quot;);</p>
<p>The above code outputs a debug message that shows the runtime the game is using.</p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div>Back: <a data-xref="{title}" href="OS_And_Compiler.htm">OS And Compiler</a></div>
<div>Next: <a data-xref="{title}" href="GM_runtime_version.htm">GM_runtime_version</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
GM_runtime_type
-->
<!-- TAGS
GM_runtime_type
-->
</body>
</html>
18 changes: 0 additions & 18 deletions Manual/contents/assets/scripts/gml.js
Original file line number Diff line number Diff line change
Expand Up @@ -3072,12 +3072,10 @@ export default function(hljs) {
* supported in the engine.)
*/
const DOT_ACCESSOR_REG = /\b\.\b/;

/**
* Expressions, which form part of a valid statement.
*/
const EXPRESSION = [];

/**
* A template string substitution. `contains` is filled in after `EXPRESSION` is defined due to
* nesting.
Expand All @@ -3089,7 +3087,6 @@ export default function(hljs) {
endScope: "literal",
contains: EXPRESSION
};

/**
* A template string substitution for use with the older `string()` optional args with `"{0}"`,
* etc.
Expand All @@ -3098,7 +3095,6 @@ export default function(hljs) {
match: /{[0-9]+}/,
scope: "literal"
};

/**
* An escape sequence in a string.
*/
Expand All @@ -3109,7 +3105,6 @@ export default function(hljs) {
{ match: /\\[^\n]/ }
]
};

/**
* Various types of strings supported in the engine.
*/
Expand Down Expand Up @@ -3153,7 +3148,6 @@ export default function(hljs) {
}
]
};

/**
* Various representations of numbers
*/
Expand All @@ -3167,7 +3161,6 @@ export default function(hljs) {
{ match: /\b[0-9][0-9_.]*/ }
]
};

/**
* Pre-processor modes for macro definitions and regions.
*/
Expand Down Expand Up @@ -3208,12 +3201,10 @@ export default function(hljs) {
},
]
};

/**
* A single-line comment.
*/
const COMMENT_LINE = hljs.COMMENT('//', /\$|\n/);

/**
* Modes for the types of comments supported in GML.
*/
Expand All @@ -3223,7 +3214,6 @@ export default function(hljs) {
hljs.C_BLOCK_COMMENT_MODE,
]
};

/**
* Dot accessor usage with a special highlighting case for `global`.
*/
Expand Down Expand Up @@ -3259,7 +3249,6 @@ export default function(hljs) {
}
},
];

/**
* Function call sites, just looking for `<ident>(`. This creates false positives
* for keywords such as `if (<condition>)`, so has lower priority in the mode `contains` list.
Expand All @@ -3274,7 +3263,6 @@ export default function(hljs) {
1: "function"
}
};

/**
* The manual likes using `obj_` and such to define assets. Sneaky trick to make it look nicer :P
*/
Expand All @@ -3286,7 +3274,6 @@ export default function(hljs) {
{ begin: "obj_" },
]
};

/**
* A ternary expression, matching partial ternary as `? <EXPRESSION> :`.
* Effectively exists to prevent {@link STRUCT_LITERAL_MEMBER} from stealing `<EXPRESSION> :`.
Expand All @@ -3296,7 +3283,6 @@ export default function(hljs) {
end: /:/,
contains: EXPRESSION
};

const SWITCH_CASE = {
begin: [
/case/,
Expand All @@ -3322,7 +3308,6 @@ export default function(hljs) {
2: "variable-instance"
},
};

/**
* A function declaration matching for:
* ```gml
Expand All @@ -3341,7 +3326,6 @@ export default function(hljs) {
3: "function"
}
};

/**
* An enum definition in the form:
* ```gml
Expand Down Expand Up @@ -3381,7 +3365,6 @@ export default function(hljs) {
}
]
};

EXPRESSION.push(
STRING,
TERNARY,
Expand All @@ -3390,7 +3373,6 @@ export default function(hljs) {
FUNCTION_CALL,
USER_ASSET_CONSTANT
);

return {
name: 'GML',
case_insensitive: false, // language is case-sensitive
Expand Down
1 change: 1 addition & 0 deletions Manual/toc/Default.toc
Original file line number Diff line number Diff line change
Expand Up @@ -3032,6 +3032,7 @@
<page href="../contents/GameMaker_Language/GML_Reference/OS_And_Compiler/GM_build_date.htm" format="html" processing-role="normal"></page>
<page href="../contents/GameMaker_Language/GML_Reference/OS_And_Compiler/GM_build_type.htm" format="html" processing-role="normal"></page>
<page href="../contents/GameMaker_Language/GML_Reference/OS_And_Compiler/GM_version.htm" format="html" processing-role="normal"></page>
<page condition="Export:Beta" href="../contents/GameMaker_Language/GML_Reference/OS_And_Compiler/GM_runtime_type.htm" format="html" processing-role="normal"></page>
<page href="../contents/GameMaker_Language/GML_Reference/OS_And_Compiler/GM_runtime_version.htm" format="html" processing-role="normal"></page>
<page href="../contents/GameMaker_Language/GML_Reference/OS_And_Compiler/GM_project_filename.htm" format="html" processing-role="normal"></page>
<page href="../contents/GameMaker_Language/GML_Reference/OS_And_Compiler/GM_is_sandboxed.htm" format="html" processing-role="normal"></page>
Expand Down

0 comments on commit 4cf3387

Please sign in to comment.