Merge pull request #78490 from clayjohn/GLES3-particles-subemit

Add warnings and fallbacks for particles sub emitters when using the GL Compatibility rendering backend
This commit is contained in:
Rémi Verschelde 2023-06-22 21:02:38 +02:00 committed by GitHub
commit cb73a6e9f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 17 deletions

View file

@ -229,7 +229,7 @@ void ParticleProcessMaterial::_update_shader() {
}
}
if (sub_emitter_mode != SUB_EMITTER_DISABLED) {
if (sub_emitter_mode != SUB_EMITTER_DISABLED && !RenderingServer::get_singleton()->is_low_end()) {
if (sub_emitter_mode == SUB_EMITTER_CONSTANT) {
code += "uniform float sub_emitter_frequency;\n";
}
@ -880,7 +880,7 @@ void ParticleProcessMaterial::_update_shader() {
code += " }\n";
}
if (sub_emitter_mode != SUB_EMITTER_DISABLED) {
if (sub_emitter_mode != SUB_EMITTER_DISABLED && !RenderingServer::get_singleton()->is_low_end()) {
code += " int emit_count = 0;\n";
switch (sub_emitter_mode) {
case SUB_EMITTER_CONSTANT: {
@ -1487,6 +1487,9 @@ void ParticleProcessMaterial::set_sub_emitter_mode(SubEmitterMode p_sub_emitter_
sub_emitter_mode = p_sub_emitter_mode;
_queue_shader_change();
notify_property_list_changed();
if (sub_emitter_mode != SUB_EMITTER_DISABLED && RenderingServer::get_singleton()->is_low_end()) {
WARN_PRINT_ONCE_ED("Sub-emitter modes other than SUB_EMITTER_DISABLED are not supported in the GL Compatibility rendering backend.");
}
}
ParticleProcessMaterial::SubEmitterMode ParticleProcessMaterial::get_sub_emitter_mode() const {