Skip to content

Releases: naelstrof/UnityPenetrationTech

OpenGL support is back in places where it can work.

15 Aug 18:16
Compare
Choose a tag to compare

I guess if OpenGL can support the StructuredBuffer in the vertex shader by if you're using the CG compiler or not. This seems to work in my test cases. OpenGL still won't work if you're using the Standard Pipeline, but URP and HDRP it works fine again!

Killed OpenGL support

09 Aug 19:27
Compare
Choose a tag to compare

I learned that the package didn't work on the Built-in pipeline. This is due to me attempting to use a StructuredBuffer in the vert shader. This isn't allowed on older versions of OpenGL. Old versions of OpenGL also do not support dynamic indexing of constant buffers.

However, one or both of these things are not true in URP. Meaning that it IS possible to get OpenGL support provided that you're using URP or HDRP-- However I don't know the specific shader defines I'd need to check to have it work under all configurations.

Instead I just axed OpenGL support entirely, this should make it work on all render pipelines provided you're using the recommended render API.

If you're someone who wants to have it work on OpenGL in URP or HDRP, the changes in this tag are the ones you'd want to undo.

In the future I plan to investigate what shader defines I could check for to make sure it works when it is able.

UI refactor in order to avoid a back-ported Unity bug.

18 Jul 06:25
Compare
Choose a tag to compare

In Unity version 2020.3.36f1, the Unity team had back-ported a UI bug that causes the first element of an SerializedReference array to display like this:

image

Since I'm using PenetrationTech in my LTS project, I've done a band-aid fix that uses the wonderful TextusGame's addon to render them instead:

image

Which doesn't fix the issue.. 😭 Though with the labels it becomes much easier to drag and drop the element you wish to work on into element 1-- which works normally.

This update shouldn't conflict with any existing installations and will probably be kept because of how darn useful TextusGame's addon is.

Instantiation optimization

14 Jul 22:53
Compare
Choose a tag to compare
  • Optimized several routines involved with generating the girth curves.
  • Now uses an ASyncGPUReadbackRequest to grab the texture data off the GPU. (Only if the platform supports it).

It's fairly slow in editor due to lots of NativeArray access, in builds its much faster. You should still prefab pool penetrators where you can if you spawn and despawn them often.

In the future I might write a mesh database lookup for the data, this would make it so that it could reuse the same girthmap data across multiple penetrators, but this is very complex and I probably won't do it.

Bugfixes

13 Jul 00:59
Compare
Choose a tag to compare
  • Fixed an issue where curves that were generated too small would cause back-verts to turn invisible (a NaN got propagated).
  • Texture allocations now happen on Start() and Destroy(), fixes a case where Unity can hard-crash.
  • Various UI fixes (correctly detects unreadable meshes rather than spamming errors.)
  • Fixed a really bad Unity bug where temporary render textures weren't getting released properly.

Blendshape support!

01 Jul 00:10
Compare
Choose a tag to compare
  • Penetrators now generate girthmaps for each blendshape, and properly blend between them. This is a significant performance cost in comparison to the old method (due to needing to send each blendshape via CPU). Pool and cache when you can!
  • Rigidbody listeners now apply friction and gravity in proportion to how deeply they're penetrated.
  • Girthmaps are no longer serialized (and cannot be viewed from the inspector, sorry!)

Bugfixes, small features.

29 Jun 04:18
Compare
Choose a tag to compare
  • Catmull Spline class now uses Cardinal Spline tangent generation for points, penetrables can specify their "tension" to help author splines.
  • Added Lengthwise Bone Depth Penetrable, it moves a bone and scales it along the spline for depth-wise penetrations.
  • Fixed issue where Penetrable girth values didn't respect the scale of the character. (Simple blendshape listener, push-pull-expand blendshape listener).
  • Fixed bug where some radiuses were treated as diameters.
  • Custom listeners written in different assemblies are now correctly identified in the inspector for adding.
  • Some functions that were private are now publicly exposed (getting the renderers of a Catmulldeformer, adding/removing renderers from procedural deformation, etc). Let me know if there's a few others that you think should be available, this is all I needed for my game.
  • Added the ability to query which penetrable a penetrator is in. (TryGetPenetrable())
  • Girthmap generation no longer erroneously clips the tip
  • Girthmap texture wrapping is set properly on each axis so it appears correctly with Procedural deformation.

New features

05 Jun 23:27
Compare
Choose a tag to compare
  • Added a rigidbody listener for penetrators, which allows them to puppet their rigidbodies in roughly the right location. With adjustable physics configuration. It's meant for stand-alone penetrators that have physics enabled on them.
    • Currently doesn't support rigidbodies with joints.
  • Added a No Collide listener for penetrators, this just grabs the parent rigidbody of the penetrable and does a no-collide with all the containing colliders. This is pretty nasty and probably should be handled by a parent script that the user creates-- though they can just safely ignore this listener if they want a cleaner version.
  • AutoPenetrate is no longer a bool, it is a set of flags that determine if it should auto penetrate and/or auto decouple. This is primarily for animators who don't want a penetrator to randomly decouple from a target just because the animation slipped up.
  • Added a configurable parameter for how leniently penetrations are detected. This can help with games or animations that just don't line up quite right.
  • Fixed bug where bilinear filtering would sample wrapped pixels on the girthmap. (values are now clamped on the U, repeated on the V).

Small bugfixes

05 Jun 01:10
Compare
Choose a tag to compare
  • Fixed issue where autoPenetrate would fail to work if the project had custom physics settings.

Small bugfix boogaloo

05 Jun 00:44
Compare
Choose a tag to compare
  • Fixed an instance where penetrators without a tipTarget would generate an inverted tangent, causing odd behavior with rotations.