Disallow antialiasing for software skinned 2d polys

Antialiasing is not supported for batched polys. Currently due to the fallback mechanism, skinned antialiased polys will be rendered without applying animation.

This PR simply treats such polys as if antialiasing had not been selected. The class reference is updated to reflect this.
This commit is contained in:
lawnjelly 2021-02-28 17:27:01 +00:00
parent 8385a0d8ad
commit 7d5cf60149
2 changed files with 12 additions and 2 deletions

View file

@ -1143,6 +1143,7 @@
<member name="rendering/quality/2d/use_software_skinning" type="bool" setter="" getter="" default="true"> <member name="rendering/quality/2d/use_software_skinning" type="bool" setter="" getter="" default="true">
If [code]true[/code], performs 2D skinning on the CPU rather than the GPU. This provides greater compatibility with a wide range of hardware, and also may be faster in some circumstances. If [code]true[/code], performs 2D skinning on the CPU rather than the GPU. This provides greater compatibility with a wide range of hardware, and also may be faster in some circumstances.
Currently only available when [member rendering/batching/options/use_batching] is active. Currently only available when [member rendering/batching/options/use_batching] is active.
[b]Note:[/b] Antialiased software skinned polys are not supported, and will be rendered without antialiasing.
</member> </member>
<member name="rendering/quality/2d/use_transform_snap" type="bool" setter="" getter="" default="false"> <member name="rendering/quality/2d/use_transform_snap" type="bool" setter="" getter="" default="false">
If [code]true[/code], forces snapping of 2D object transforms to the nearest whole coordinate. If [code]true[/code], forces snapping of 2D object transforms to the nearest whole coordinate.

View file

@ -2282,7 +2282,16 @@ PREAMBLE(bool)::prefill_joined_item(FillState &r_fill_state, int &r_command_star
#ifdef GLES_OVER_GL #ifdef GLES_OVER_GL
// anti aliasing not accelerated .. it is problematic because it requires a 2nd line drawn around the outside of each // anti aliasing not accelerated .. it is problematic because it requires a 2nd line drawn around the outside of each
// poly, which would require either a second list of indices or a second list of vertices for this step // poly, which would require either a second list of indices or a second list of vertices for this step
bool use_legacy_path = false;
if (polygon->antialiased) { if (polygon->antialiased) {
// anti aliasing is also not supported for software skinned meshes.
// we can't easily revert, so we force software skinned meshes to run through
// batching path with no AA.
use_legacy_path = !bdata.settings_use_software_skinning || p_item->skeleton == RID();
}
if (use_legacy_path) {
// not accelerated // not accelerated
_prefill_default_batch(r_fill_state, command_num, *p_item); _prefill_default_batch(r_fill_state, command_num, *p_item);
} else { } else {
@ -2298,9 +2307,9 @@ PREAMBLE(bool)::prefill_joined_item(FillState &r_fill_state, int &r_command_star
bool buffer_full = false; bool buffer_full = false;
if (send_light_angles) { if (send_light_angles) {
// NYI // polygon with light angles is not yet implemented
// for batching .. this means software skinned with light angles won't work
_prefill_default_batch(r_fill_state, command_num, *p_item); _prefill_default_batch(r_fill_state, command_num, *p_item);
//buffer_full = prefill_polygon<true>(polygon, r_fill_state, r_command_start, command_num, command_count, p_item, multiply_final_modulate);
} else } else
buffer_full = _prefill_polygon<false>(polygon, r_fill_state, r_command_start, command_num, command_count, p_item, multiply_final_modulate); buffer_full = _prefill_polygon<false>(polygon, r_fill_state, r_command_start, command_num, command_count, p_item, multiply_final_modulate);