如何在 Unity3D 中使用 NVIDIA FleX 制作软体果冻球? [英] How do I make a softbody jello sphere with NVIDIA FleX in Unity3D?

查看:45
本文介绍了如何在 Unity3D 中使用 NVIDIA FleX 制作软体果冻球?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用

那么您还应该创建一个 Flex Soft Asset...

然后您应该创建或选择一个游戏对象,并通过游戏对象检查器中的添加组件选项卡,找到 Flex Soft Actor 组件[请参阅下图中加载的内容]...

确保您之前提到的 Soft Actor Asset 在检查器选项中选择了您所需的网格类型 [我在此处的图像中选择了球体] 并检查它是否与下图类似,以确保...

所以在那之后,希望你可以按下播放键,看看它在为你下降和扭曲时的动作.

如果没有,我已经创建了一个快速示例供您下载为统一包.

它可能仍需要使用包管理器进一步解决,因为 Flex 插件已经在我在这里提供的包中[使用 Unity 2020.3.5f1]统一包中的Flex

无论如何,希望这能让您开始使用 Flex 并朝着您的目标迈进.作为奖励,我添加了一个小脚本来移动 flex 对象,因为这超出了通常的方法,因为我们必须调用所选的 NVidia Flex 组件类并调用 ApplyImpulse 方法.

干杯:)

NV Gameworks 提供了 3 组关于将插件与 Unity 集成并举例说明一些内容的小教程 - 这个东西"包含在我上面提供的可下载包中.这是 3 组的 youtube 链接:

Youtube 上的 Nvidia Gameworks FleX 教程

编辑 2:重读你的问题让我觉得我并没有真正给你关于使用布料 actor 和让网格渲染器通过 flex 布料变形组件变形的明确答案.我在这里提供了另一个统一包的另一个链接,该链接将在此处显示此操作,还允许您查看游戏对象以及来自 NVIDIA Flex 的布料组件如何与标准网格过滤器和网格渲染器配合使用.希望这更准确地回答您的问题:)同样在 NVIDIA FleX 中使用 Cloth Actor 和 Soft Actor 的示例

I am currently using the NVIDIA FleX package in Unity3D to create soft-bodied, jelly objects. I'm using Unity for animation only, not game dev.

What I am aiming to make is a transparent, jello sphere that retains its spherical shape with elasticity.

The first way I've tried to achieve this is using Flex Array + fluid setting. I've been playing with the settings but I can't get it to remain a sphere, it just becomes a more/less viscous fluid blob.

The second way is using the Flex Soft + fluid setting. It is much better in terms of physics but even with "draw particles" off, but the water droplets are each separated and not one jelly sphere.

This is what it looks like before hitting play, where the left is with Flex Array and the right is Flex Soft. The particles for Array are visible but not for Soft. This is after hitting play, where the Array becomes one viscous fluid, but not a sphere, and the Soft is very jello-like but the water droplets are all separated.

A solution for either of the two ways would be much appreciated!

解决方案

the standard approach is to create an Nvidia Flex Controller first...

Then you should also create a Flex Soft Asset...

Then you should create or select a game object and through the Add Component tab in the game object's inspector, find the Flex Soft Actor component [see it loaded up in the image below]...

Ensure your Soft Actor Asset mentioned previously has your required mesh type selected in the inspector option [I chose sphere in the image here] and check to see it looks something like the image below to be sure...

So after that, hopefully, you can just press play and see it in action as it drops and contorts for you.

If not, I have created a quick example for you to download as a unitypackage.

It may still require further resolution with the package manager as the Flex plugin is already inside the package I'm providing here[Using Unity 2020.3.5f1] Flex in unity package

Anyway, hope this gets you started and somewhere towards your goal with Flex. As a bonus, I've added a small script to move the flex object as this is outside of the usual approach as we have to call to the NVidia Flex component class of choice and invoke the ApplyImpulse method.

Cheers :)

Edit: There are a small 3 set of tutorials from NV Gameworks on integrating the plugin with Unity and exampling some stuff - this "stuff" is included in my downloadable package provided above. Here is the youtube link to the 3 set:

Nvidia Gameworks FleX tutorials on Youtube

Edit 2: rereading your question made me think I hadnt really given you the definitive answer as to using a cloth actor and having the mesh renderer deform via the flex cloth deform component. I am providing another link to another unity package here that will show this in action also allowing you to see the game object and how the cloth component from NVIDIA Flex works with the standard mesh filter and mesh renderer. Hope this more accurately answers your question :) Example also using Cloth Actors as well as Soft Actors in NVIDIA FleX

这篇关于如何在 Unity3D 中使用 NVIDIA FleX 制作软体果冻球?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆