Implement Octahedral Compression for normal/tangent vectors
*Oct32 for uncompressed vectors
*Oct16 for compressed vectors
Reduces vertex size for each attribute by
*Uncompressed: 12 bytes, vec4<float32> -> vec2<unorm16>
*Compressed: 2 bytes, vec4<unorm8> -> vec2<unorm8>
Binormal sign is encoded in the y coordinate of the encoded tangent
Added conversion functions to go from octahedral mapping to cartesian
for normal and tangent vectors
sprite_3d and soft_body meshes write to their vertex buffer memory
directly and need to convert their normals and tangents to the new oct
format before writing
Created a new mesh flag to specify whether a mesh is using octahedral
compression or not
Updated documentation to discuss new flag/defaults
Created shader flags to specify whether octahedral or cartesian vectors
are being used
Updated importers to use octahedral representation as the default format
for importing meshes
Updated ShaderGLES2 to support 64 bit version codes as we hit the limit
of the 32-bit integer that was previously used as a bitset to store
enabled/disabled flags
Added additional param to action related methods to test for exactness.
If "p_exact_match" is true, then the action will only be "matched" if the provided input event *exactly* matches with the action event.
Before:
* Action Event = KEY_S
* Input Event = KEY_CONTROL + KEY_S
* Is Action Pressed = True
Now:
You can still do the above, however you can optionally check that the input is exactly what the action event is:
* Action Event = KEY_S
* Input Event = KEY_CONTROL + KEY_S
* p_exact_match = True
* Is Action Pressed = False
* If the Input Event was only KEY_S, then the result would be true.
Usage:
```gdscript
Input.is_action_pressed(action_name: String, exact_match: bool)
Input.is_action_pressed("my_action", true)
InputMap.event_is_action(p_event, "my_action", true)
func _input(event: InputEvent):
event.is_action_pressed("my_action", false, true) # false = "allow_echo", true = "exact_match"
event.is_action("my_action", true)
```
Co-authored-by: Eric M <itsjusteza@gmail.com>
If the user changed the portal Z scale in the editor the portal margin display could become incorrectly sized.
This is because the portal margin is measured in world space units, and has to be back calculated into model space using the inverse global transform of the portal node. The model space size of the margin is thus tied to the current scale of the node.
This PR forces updating the gizmo each time the transform is changed. This isn't super efficient, but as this is an editor only feature it should be okay, and it is unlikely to be a performance problem.
Due to a quirk in CSG Shapes, updating is usually deferred to the next frame. This is problematic as we need to read back the geometry on the first frame when converting levels.
This PR adds a function to CSGShape to force immediate updating (if dirty), and calls it during room conversion.
Portal margins were not being correctly sent to the PortalRenderer from the SceneTree, so all margins were being used as default (1.0). This PR fixes this.
The default autoplace algorithm places instances in the highest priority Room. It became apparent that there are some situations in which users will want to override this and force placement in a Room from a particular RoomGroup, especially an "outside" RoomGroup.
This setting allows the user to specify a preference for Room priority. When set to 0, the setting is ignored and the highest priority Room is chosen.
Although explicit portals did a check to detect internal portals, this check was missing from autolinked portals. This meant they were incorrectly clipping the room bounds of the enclosing outer room.
This PR adds a check for internal rooms during the autolinking and sets the internal flag where needed.
- Use background and line colors that match better with the
rest of the editor.
- Use translucent lines to make overlapping lines visible.
- Tweak the error message to mention the UV layer in question
when there is no UV for a defined layer.
(cherry picked from commit 8cdfd2e706)
- Allow some tolerance when clicking the plane move/scale,
even if the click is actually slightly outside the plane
(similar to Blender).
- Make the rotate manipulation circles visually thinner to be
less distracting.
- Make the hovered color less saturated to be more distinguishable
from the non-hovered state.
- Don't set brightness above 1.0 to prevent the gizmo from glowing
when hovered.
(cherry picked from commit 6cfcbbbb93)
The default portal margin is stored in the RoomManager. Previously this was propagated to Portals when the value was changed, and Portals each stored this default value.
This caused a bug during loading, if the RoomManager was loaded before Portals, the value was never propagated.
This PR makes the default margin a static value stored in the RoomManager, and the Portals now read directly from the static value when required, and do not store locally. This gets around the problem.
Use `System.Array.Empty<T>` to get an empty array instead of allocating
a new one every time. Since arrays are immutable there is no need to
allocate them every time.
(cherry picked from commit accd05f4ad)