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

Add stencil support to spatial materials #80710

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
88 changes: 88 additions & 0 deletions doc/classes/BaseMaterial3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@
<member name="depth_draw_mode" type="int" setter="set_depth_draw_mode" getter="get_depth_draw_mode" enum="BaseMaterial3D.DepthDrawMode" default="0">
Determines when depth rendering takes place. See [enum DepthDrawMode]. See also [member transparency].
</member>
<member name="depth_function" type="int" setter="set_depth_function" getter="get_depth_function" enum="BaseMaterial3D.DepthFunction" default="0">
Copy link

@EnlightenedOne EnlightenedOne Nov 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the default should be "5" (or the enum should be reordered)?

Determines which comparison operator is used when testing depth. See [enum DepthFunction].
[b]Note:[/b] Changing [member depth_function] to a non-default value only has a visible effect when used on a transparent material, or a material that has [member depth_draw_mode] set to [constant DEPTH_DRAW_DISABLED].
</member>
<member name="detail_albedo" type="Texture2D" setter="set_texture" getter="get_texture">
Texture that specifies the color of the detail overlay. [member detail_albedo]'s alpha channel is used as a mask, even when the material is opaque. To use a dedicated texture as a mask, see [member detail_mask].
[b]Note:[/b] [member detail_albedo] is [i]not[/i] modulated by [member albedo_color].
Expand Down Expand Up @@ -359,6 +363,24 @@
The method for rendering the specular blob. See [enum SpecularMode].
[b]Note:[/b] [member specular_mode] only applies to the specular blob. It does not affect specular reflections from the sky, screen-space reflections, [VoxelGI], SDFGI or [ReflectionProbe]s. To disable reflections from these sources as well, set [member metallic_specular] to [code]0.0[/code] instead.
</member>
<member name="stencil_color" type="Color" setter="set_stencil_effect_color" getter="get_stencil_effect_color">
The primary color of the stencil effect.
</member>
<member name="stencil_compare" type="int" setter="set_stencil_compare" getter="get_stencil_compare" enum="BaseMaterial3D.StencilCompare">
The comparison operator to use for stencil masking operations. See [enum StencilCompare].
</member>
<member name="stencil_flags" type="int" setter="set_stencil_flags" getter="get_stencil_flags">
The flags dictating how the stencil operation behaves. See [enum StencilFlags].
</member>
<member name="stencil_mode" type="int" setter="set_stencil_mode" getter="get_stencil_mode" enum="BaseMaterial3D.StencilMode" default="0">
The stencil effect mode. See [enum StencilMode].
</member>
<member name="stencil_outline_thickness" type="float" setter="set_stencil_effect_outline_thickness" getter="get_stencil_effect_outline_thickness">
The outline thickness for STENCIL_MODE_OUTLINE.
</member>
<member name="stencil_reference" type="int" setter="set_stencil_reference" getter="get_stencil_reference">
The stencil reference value (0-255). Typically a power of 2.
</member>
<member name="subsurf_scatter_enabled" type="bool" setter="set_feature" getter="get_feature" default="false">
If [code]true[/code], subsurface scattering is enabled. Emulates light that penetrates an object's surface, is scattered, and then emerges. Subsurface scattering quality is controlled by [member ProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_quality].
</member>
Expand Down Expand Up @@ -631,6 +653,30 @@
<constant name="DEPTH_DRAW_DISABLED" value="2" enum="DepthDrawMode">
Objects will not write their depth to the depth buffer, even during the depth prepass (if enabled).
</constant>
<constant name="DEPTH_FUNCTION_LESS_OR_EQUAL" value="0" enum="DepthFunction">
Depth check succeeds if less than or equal to existing depth.
</constant>
<constant name="DEPTH_FUNCTION_LESS" value="1" enum="DepthFunction">
Depth check succeeds if less than existing depth.
</constant>
<constant name="DEPTH_FUNCTION_EQUAL" value="2" enum="DepthFunction">
Depth check succeeds if equal to existing depth.
</constant>
<constant name="DEPTH_FUNCTION_GREATER" value="3" enum="DepthFunction">
Depth check succeeds if greater than existing depth.
</constant>
<constant name="DEPTH_FUNCTION_NOT_EQUAL" value="4" enum="DepthFunction">
Depth check succeeds if not equal to existing depth.
</constant>
<constant name="DEPTH_FUNCTION_GREATER_OR_EQUAL" value="5" enum="DepthFunction">
Default depth function. Depth check succeeds if greater than or equal to existing depth.
</constant>
<constant name="DEPTH_FUNCTION_ALWAYS" value="6" enum="DepthFunction">
Depth check always succeeds.
</constant>
<constant name="DEPTH_FUNCTION_NEVER" value="7" enum="DepthFunction">
Depth check never succeeds.
</constant>
<constant name="CULL_BACK" value="0" enum="CullMode">
Default cull mode. The back of the object is culled when not visible. Back face triangles will be culled when facing the camera. This results in only the front side of triangles being drawn. For closed-surface meshes, this means that only the exterior of the mesh will be visible.
</constant>
Expand Down Expand Up @@ -777,5 +823,47 @@
<constant name="DISTANCE_FADE_OBJECT_DITHER" value="3" enum="DistanceFadeMode">
Smoothly fades the object out based on the object's distance from the camera using a dithering approach. Dithering discards pixels based on a set pattern to smoothly fade without enabling transparency. On certain hardware, this can be faster than [constant DISTANCE_FADE_PIXEL_ALPHA] and [constant DISTANCE_FADE_PIXEL_DITHER].
</constant>
<constant name="STENCIL_MODE_DISABLED" value="0" enum="StencilMode">
Disables stencil operations.
</constant>
<constant name="STENCIL_MODE_OUTLINE" value="1" enum="StencilMode">
Stencil preset which applies an outline to the object. Requires a next_pass.
</constant>
<constant name="STENCIL_MODE_XRAY" value="2" enum="StencilMode">
Stencil preset which shows a silhouette of the object behind walls. Requires a next_pass.
</constant>
<constant name="STENCIL_MODE_CUSTOM" value="3" enum="StencilMode">
Enables stencil operations without a preset.
</constant>
<constant name="STENCIL_FLAG_READ" value="1" enum="StencilFlags">
The material will only be rendered where it passes a stencil comparison with existing stencil buffer values. See [enum StencilCompare].
</constant>
<constant name="STENCIL_FLAG_WRITE" value="2" enum="StencilFlags">
The material will write the reference value to the stencil buffer where it passes the depth test.
</constant>
<constant name="STENCIL_FLAG_WRITE_DEPTH_FAIL" value="4" enum="StencilFlags">
The material will write the reference value to the stencil buffer where it fails the depth test.
</constant>
<constant name="STENCIL_COMPARE_LESS" value="0" enum="StencilCompare">
Passes the stencil test when the reference value is less than the existing stencil value.
</constant>
<constant name="STENCIL_COMPARE_EQUAL" value="1" enum="StencilCompare">
Passes the stencil test when the reference value is equal to the existing stencil value.
</constant>
<constant name="STENCIL_COMPARE_LESS_OR_EQUAL" value="2" enum="StencilCompare">
Passes the stencil test when the reference value is less than or equal to the existing stencil value.
</constant>
<constant name="STENCIL_COMPARE_GREATER" value="3" enum="StencilCompare">
Passes the stencil test when the reference value is greater than the existing stencil value.
</constant>
<constant name="STENCIL_COMPARE_NOT_EQUAL" value="4" enum="StencilCompare">
Passes the stencil test when the reference value is not equal to the existing stencil value.
</constant>
<constant name="STENCIL_COMPARE_GREATER_OR_EQUAL" value="5" enum="StencilCompare">
Passes the stencil test when the reference value is greater than or equal to the existing stencil value.
</constant>
<constant name="STENCIL_COMPARE_ALWAYS" value="6" enum="StencilCompare">
Always passes the stencil test.
</constant>
</constants>
</class>
15 changes: 9 additions & 6 deletions drivers/gles3/rasterizer_scene_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2190,7 +2190,7 @@ void RasterizerSceneGLES3::_render_shadow_pass(RID p_light, RID p_shadow_atlas,
scene_state.reset_gl_state();
scene_state.enable_gl_depth_test(true);
scene_state.enable_gl_depth_draw(true);
glDepthFunc(GL_GREATER);
scene_state.set_gl_depth_func(GLES3::SceneShaderData::DEPTH_FUNCTION_GREATER);

glColorMask(0, 0, 0, 0);
glDrawBuffers(0, nullptr);
Expand Down Expand Up @@ -2493,7 +2493,7 @@ void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_
scene_state.enable_gl_depth_test(true);
scene_state.enable_gl_depth_draw(true);
scene_state.enable_gl_blend(false);
glDepthFunc(GL_GEQUAL);
scene_state.set_gl_depth_func(GLES3::SceneShaderData::DEPTH_FUNCTION_GREATER_OR_EQUAL);
scene_state.enable_gl_scissor_test(false);

glColorMask(0, 0, 0, 0);
Expand Down Expand Up @@ -2531,7 +2531,7 @@ void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_
scene_state.enable_gl_scissor_test(false);
scene_state.enable_gl_depth_test(true);
scene_state.enable_gl_depth_draw(true);
glDepthFunc(GL_GEQUAL);
scene_state.set_gl_depth_func(GLES3::SceneShaderData::DEPTH_FUNCTION_GREATER_OR_EQUAL);

{
GLuint db = GL_COLOR_ATTACHMENT0;
Expand Down Expand Up @@ -2591,6 +2591,7 @@ void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_
RENDER_TIMESTAMP("Render Sky");

scene_state.enable_gl_depth_test(true);
scene_state.set_gl_depth_func(GLES3::SceneShaderData::DEPTH_FUNCTION_GREATER_OR_EQUAL);
scene_state.enable_gl_blend(false);
scene_state.set_gl_cull_mode(GLES3::SceneShaderData::CULL_BACK);

Expand Down Expand Up @@ -2971,6 +2972,8 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params,
scene_state.enable_gl_depth_test(shader->depth_test == GLES3::SceneShaderData::DEPTH_TEST_ENABLED);
}

scene_state.set_gl_depth_func(shader->depth_function);

if constexpr (p_pass_mode != PASS_MODE_SHADOW) {
if (shader->depth_draw == GLES3::SceneShaderData::DEPTH_DRAW_OPAQUE) {
scene_state.enable_gl_depth_draw((p_pass_mode == PASS_MODE_COLOR && !GLES3::Config::get_singleton()->use_depth_prepass) || p_pass_mode == PASS_MODE_DEPTH);
Expand Down Expand Up @@ -3606,7 +3609,7 @@ void RasterizerSceneGLES3::render_particle_collider_heightfield(RID p_collider,
scene_state.reset_gl_state();
scene_state.enable_gl_depth_test(true);
scene_state.enable_gl_depth_draw(true);
glDepthFunc(GL_GREATER);
scene_state.set_gl_depth_func(GLES3::SceneShaderData::DEPTH_FUNCTION_GREATER);

glDrawBuffers(0, nullptr);

Expand Down Expand Up @@ -3652,7 +3655,7 @@ void RasterizerSceneGLES3::_render_uv2(const PagedArray<RenderGeometryInstance *
scene_state.reset_gl_state();
scene_state.enable_gl_depth_test(true);
scene_state.enable_gl_depth_draw(true);
glDepthFunc(GL_GREATER);
scene_state.set_gl_depth_func(GLES3::SceneShaderData::DEPTH_FUNCTION_GREATER);

TightLocalVector<GLenum> draw_buffers;
draw_buffers.push_back(GL_COLOR_ATTACHMENT0);
Expand Down Expand Up @@ -3745,7 +3748,7 @@ void RasterizerSceneGLES3::_render_buffers_debug_draw(Ref<RenderSceneBuffersGLES
glViewport(0, 0, shadow_atlas_size, shadow_atlas_size);
glActiveTexture(GL_TEXTURE0);
scene_state.enable_gl_depth_draw(true);
glDepthFunc(GL_ALWAYS);
scene_state.set_gl_depth_func(GLES3::SceneShaderData::DEPTH_FUNCTION_ALWAYS);
scene_state.set_gl_cull_mode(GLES3::SceneShaderData::CULL_DISABLED);

// Loop through quadrants and copy shadows over.
Expand Down
22 changes: 22 additions & 0 deletions drivers/gles3/rasterizer_scene_gles3.h
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ class RasterizerSceneGLES3 : public RendererSceneRender {
bool used_depth_prepass = false;

GLES3::SceneShaderData::BlendMode current_blend_mode = GLES3::SceneShaderData::BLEND_MODE_MIX;
GLES3::SceneShaderData::DepthFunction current_depth_function = GLES3::SceneShaderData::DEPTH_FUNCTION_GREATER_OR_EQUAL;
GLES3::SceneShaderData::Cull cull_mode = GLES3::SceneShaderData::CULL_BACK;

bool current_blend_enabled = false;
Expand All @@ -482,6 +483,9 @@ class RasterizerSceneGLES3 : public RendererSceneRender {
current_depth_draw_enabled = false;
glDisable(GL_DEPTH_TEST);
current_depth_test_enabled = false;

glDepthFunc(GL_GEQUAL);
current_depth_function = GLES3::SceneShaderData::DEPTH_FUNCTION_GREATER_OR_EQUAL;
}

void set_gl_cull_mode(GLES3::SceneShaderData::Cull p_mode) {
Expand Down Expand Up @@ -539,6 +543,24 @@ class RasterizerSceneGLES3 : public RendererSceneRender {
}
}

void set_gl_depth_func(GLES3::SceneShaderData::DepthFunction p_depth_func) {
if (current_depth_function != p_depth_func) {
GLenum depth_function_table[GLES3::SceneShaderData::DEPTH_FUNCTION_MAX] = {
GL_LEQUAL,
GL_LESS,
GL_EQUAL,
GL_GREATER,
GL_NOTEQUAL,
GL_GEQUAL,
GL_ALWAYS,
GL_NEVER,
};

glDepthFunc(depth_function_table[p_depth_func]);
current_depth_function = p_depth_func;
}
}

bool texscreen_copied = false;
bool used_screen_texture = false;
bool used_normal_texture = false;
Expand Down
11 changes: 11 additions & 0 deletions drivers/gles3/storage/material_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2894,6 +2894,7 @@ void SceneShaderData::set_code(const String &p_code) {
// Actual enums set further down after compilation.
int blend_modei = BLEND_MODE_MIX;
int depth_testi = DEPTH_TEST_ENABLED;
int depth_functioni = DEPTH_FUNCTION_GREATER_OR_EQUAL;
int alpha_antialiasing_modei = ALPHA_ANTIALIASING_OFF;
int cull_modei = CULL_BACK;
int depth_drawi = DEPTH_DRAW_OPAQUE;
Expand All @@ -2918,6 +2919,15 @@ void SceneShaderData::set_code(const String &p_code) {

actions.render_mode_values["depth_test_disabled"] = Pair<int *, int>(&depth_testi, DEPTH_TEST_DISABLED);

actions.render_mode_values["depth_function_less_or_equal"] = Pair<int *, int>(&depth_functioni, DEPTH_FUNCTION_LESS_OR_EQUAL);
actions.render_mode_values["depth_function_less"] = Pair<int *, int>(&depth_functioni, DEPTH_FUNCTION_LESS);
actions.render_mode_values["depth_function_equal"] = Pair<int *, int>(&depth_functioni, DEPTH_FUNCTION_EQUAL);
actions.render_mode_values["depth_function_greater"] = Pair<int *, int>(&depth_functioni, DEPTH_FUNCTION_GREATER);
actions.render_mode_values["depth_function_not_equal"] = Pair<int *, int>(&depth_functioni, DEPTH_FUNCTION_NOT_EQUAL);
actions.render_mode_values["depth_function_greater_or_equal"] = Pair<int *, int>(&depth_functioni, DEPTH_FUNCTION_GREATER_OR_EQUAL);
actions.render_mode_values["depth_function_always"] = Pair<int *, int>(&depth_functioni, DEPTH_FUNCTION_ALWAYS);
actions.render_mode_values["depth_function_never"] = Pair<int *, int>(&depth_functioni, DEPTH_FUNCTION_NEVER);

actions.render_mode_values["cull_disabled"] = Pair<int *, int>(&cull_modei, CULL_DISABLED);
actions.render_mode_values["cull_front"] = Pair<int *, int>(&cull_modei, CULL_FRONT);
actions.render_mode_values["cull_back"] = Pair<int *, int>(&cull_modei, CULL_BACK);
Expand Down Expand Up @@ -2978,6 +2988,7 @@ void SceneShaderData::set_code(const String &p_code) {
alpha_antialiasing_mode = AlphaAntiAliasing(alpha_antialiasing_modei);
depth_draw = DepthDraw(depth_drawi);
depth_test = DepthTest(depth_testi);
depth_function = DepthFunction(depth_functioni);
cull_mode = Cull(cull_modei);

vertex_input_mask = RS::ARRAY_FORMAT_VERTEX | RS::ARRAY_FORMAT_NORMAL; // We can always read vertices and normals.
Expand Down
13 changes: 13 additions & 0 deletions drivers/gles3/storage/material_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,18 @@ struct SceneShaderData : public ShaderData {
DEPTH_TEST_ENABLED
};

enum DepthFunction {
DEPTH_FUNCTION_LESS_OR_EQUAL,
DEPTH_FUNCTION_LESS,
DEPTH_FUNCTION_EQUAL,
DEPTH_FUNCTION_GREATER,
DEPTH_FUNCTION_NOT_EQUAL,
DEPTH_FUNCTION_GREATER_OR_EQUAL,
DEPTH_FUNCTION_ALWAYS,
DEPTH_FUNCTION_NEVER,
DEPTH_FUNCTION_MAX
};

enum Cull {
CULL_DISABLED,
CULL_FRONT,
Expand Down Expand Up @@ -292,6 +304,7 @@ struct SceneShaderData : public ShaderData {
AlphaAntiAliasing alpha_antialiasing_mode;
DepthDraw depth_draw;
DepthTest depth_test;
DepthFunction depth_function;
Cull cull_mode;

bool uses_point_size;
Expand Down
70 changes: 54 additions & 16 deletions editor/plugins/text_shader_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,17 +268,35 @@ void ShaderTextEditor::_load_theme_settings() {
}
}

const Vector<ShaderLanguage::ModeInfo> &modes = ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(i));
{
const Vector<ShaderLanguage::ModeInfo> &render_modes = ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(i));

for (int j = 0; j < render_modes.size(); j++) {
const ShaderLanguage::ModeInfo &mode_info = render_modes[j];

if (!mode_info.options.is_empty()) {
for (int k = 0; k < mode_info.options.size(); k++) {
built_ins.push_back(String(mode_info.name) + "_" + String(mode_info.options[k]));
Comment on lines +274 to +279
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (int j = 0; j < render_modes.size(); j++) {
const ShaderLanguage::ModeInfo &mode_info = render_modes[j];
if (!mode_info.options.is_empty()) {
for (int k = 0; k < mode_info.options.size(); k++) {
built_ins.push_back(String(mode_info.name) + "_" + String(mode_info.options[k]));
for (const ShaderLanguage::ModeInfo &mode_info : render_modes) {
if (!mode_info.options.is_empty()) {
for (const StringName &option : mode_info.options) {
built_ins.push_back(String(mode_info.name) + "_" + String(option));

Use for-each syntax when applicable

}
} else {
built_ins.push_back(String(mode_info.name));
}
}
}

for (int j = 0; j < modes.size(); j++) {
const ShaderLanguage::ModeInfo &mode_info = modes[j];
{
const Vector<ShaderLanguage::ModeInfo> &stencil_modes = ShaderTypes::get_singleton()->get_stencil_modes(RenderingServer::ShaderMode(i));

if (!mode_info.options.is_empty()) {
for (int k = 0; k < mode_info.options.size(); k++) {
built_ins.push_back(String(mode_info.name) + "_" + String(mode_info.options[k]));
for (int j = 0; j < stencil_modes.size(); j++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

const ShaderLanguage::ModeInfo &mode_info = stencil_modes[j];

if (!mode_info.options.is_empty()) {
for (int k = 0; k < mode_info.options.size(); k++) {
built_ins.push_back(String(mode_info.name) + "_" + String(mode_info.options[k]));
}
} else {
built_ins.push_back(String(mode_info.name));
}
} else {
built_ins.push_back(String(mode_info.name));
}
}
}
Expand All @@ -289,17 +307,35 @@ void ShaderTextEditor::_load_theme_settings() {
}
}

const Vector<ShaderLanguage::ModeInfo> &modes = ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode()));
{
const Vector<ShaderLanguage::ModeInfo> &shader_modes = ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode()));

for (int i = 0; i < shader_modes.size(); i++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

const ShaderLanguage::ModeInfo &mode_info = shader_modes[i];

if (!mode_info.options.is_empty()) {
for (int j = 0; j < mode_info.options.size(); j++) {
built_ins.push_back(String(mode_info.name) + "_" + String(mode_info.options[j]));
}
} else {
built_ins.push_back(String(mode_info.name));
}
}
}

{
const Vector<ShaderLanguage::ModeInfo> &stencil_modes = ShaderTypes::get_singleton()->get_stencil_modes(RenderingServer::ShaderMode(shader->get_mode()));

for (int i = 0; i < modes.size(); i++) {
const ShaderLanguage::ModeInfo &mode_info = modes[i];
for (int i = 0; i < stencil_modes.size(); i++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

const ShaderLanguage::ModeInfo &mode_info = stencil_modes[i];

if (!mode_info.options.is_empty()) {
for (int j = 0; j < mode_info.options.size(); j++) {
built_ins.push_back(String(mode_info.name) + "_" + String(mode_info.options[j]));
if (!mode_info.options.is_empty()) {
for (int j = 0; j < mode_info.options.size(); j++) {
built_ins.push_back(String(mode_info.name) + "_" + String(mode_info.options[j]));
}
} else {
built_ins.push_back(String(mode_info.name));
}
} else {
built_ins.push_back(String(mode_info.name));
}
}
}
Expand Down Expand Up @@ -436,6 +472,7 @@ void ShaderTextEditor::_code_complete_script(const String &p_code, List<ScriptLa
_check_shader_mode();
comp_info.functions = ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(shader->get_mode()));
comp_info.render_modes = ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode()));
comp_info.stencil_modes = ShaderTypes::get_singleton()->get_stencil_modes(RenderingServer::ShaderMode(shader->get_mode()));
comp_info.shader_types = ShaderTypes::get_singleton()->get_types();

sl.complete(code, comp_info, r_options, calltip);
Expand Down Expand Up @@ -540,6 +577,7 @@ void ShaderTextEditor::_validate_script() {
Shader::Mode mode = shader->get_mode();
comp_info.functions = ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(mode));
comp_info.render_modes = ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(mode));
comp_info.stencil_modes = ShaderTypes::get_singleton()->get_stencil_modes(RenderingServer::ShaderMode(mode));
comp_info.shader_types = ShaderTypes::get_singleton()->get_types();
}

Expand Down
Loading
Loading