


















技术领域technical field
本申请涉及游戏领域,具体而言,涉及一种虚拟对象的渲染方法和装置、存储介质、电子装置。The present application relates to the field of games, and in particular, to a method and device for rendering virtual objects, a storage medium, and an electronic device.
背景技术Background technique
当前,随着玩家和开发者对游戏品质的追求,更逼真自然的动画效果已成为诸多游戏的目标之一。这其中,实时布料模拟作为一个关键特性,可以广泛应用在角色服装,场景柔体等诸多情景下,既可改善传统骨骼动画表现僵硬、细节粗糙的不足,也能解决顶点动画无法交互、存贮量大的问题,从而大幅提升游戏的真实感体验,如图1所示。At present, with the pursuit of game quality by players and developers, more realistic and natural animation effects have become one of the goals of many games. Among them, real-time cloth simulation, as a key feature, can be widely used in many scenarios such as character clothing, scene soft body, etc. It can not only improve the rigid performance and rough details of traditional skeletal animation, but also solve the problem that vertex animation cannot interact and store. A large number of problems can be solved, thereby greatly improving the realistic experience of the game, as shown in Figure 1.
目前常用的物理引擎PhysX、Bullet和Havok中提供有完整的布料系统,其中Nvidia的PhysX应用较为广泛,当前主流的两大3D引擎Unity和Unreal都缺省使用了PhysX中的布料解决方案。主流的布料模拟的算法是基于力的质点弹簧模型(Mass-SpringModel)和基于位置的约束求解模型(Position Based Dynamic)。At present, the commonly used physics engines PhysX, Bullet and Havok provide a complete cloth system. Among them, Nvidia's PhysX is widely used. The two current mainstream 3D engines, Unity and Unreal, both use the cloth solution in PhysX by default. The mainstream cloth simulation algorithms are the force-based mass-spring model (Mass-Spring Model) and the position-based constraint solving model (Position Based Dynamic).
在弹簧质点模型中,如图2所示,把模型的顶点看作质点,质点之间的关系用弹簧表示,弹簧可以设置为不同的类型,如拉伸弹簧(stretch springs)、剪切弹簧(ShearSprings)和弯曲弹簧(bend springs)。在模拟时根据外力(如重力、风力等)和弹簧弹力计算每个质点的受力,然后计算加速度,再计算出质点在一个很短的时间步长内的速度和位置,为使模拟结果稳定,通常设置较小的步长,每帧进行多次迭代求解,这种方案的计算量比较大。In the spring mass model, as shown in Figure 2, the vertices of the model are regarded as mass points, and the relationship between the mass points is represented by springs. The springs can be set to different types, such as stretch springs, shear springs ( ShearSprings) and bend springs. In the simulation, the force of each particle is calculated according to the external force (such as gravity, wind, etc.) and the spring force, and then the acceleration is calculated, and then the speed and position of the particle in a very short time step are calculated. In order to stabilize the simulation results , usually set a small step size, and perform multiple iterative solutions per frame, which requires a large amount of calculation.
基于位置的约束求解模型和弹簧质点模型类似,只是顶点之间的关系用约束来表示,而且模型的求解不是基于力的,而是基于位置,求解约束函数。和弹簧质点模型相比,基于位置的约束求解模型稳定性更好些,但在模拟时还是要迭代计算,仍然需要大量的计算。可见,从算法上来说,布料的运行时间runtime计算开销比较大。The position-based constraint solution model is similar to the spring-mass model, except that the relationship between the vertices is represented by constraints, and the solution of the model is not based on force, but based on position, to solve the constraint function. Compared with the spring-mass model, the position-based constraint solution model is more stable, but it still needs to be calculated iteratively during simulation, which still requires a lot of calculations. It can be seen that from the algorithm point of view, the runtime calculation cost of the cloth running time is relatively large.
考虑到目前Unity引擎在手游领域的广泛应用,在Unity的布料实现中,Unity的布料系统基于Nvidia的PhysX实现,并进行了大量的封装,屏蔽了内部的细节,简化布料的使用。Unity的布料被封装成一个Component,其使用方法很简单:首先,在SkinnedMeshRenderer所在的gameObject上添加cloth component;然后编辑布料每个顶点的属性,在cloth组件中调整其他属性和碰撞体信息;实现的效果如图3所示。Considering the current wide application of the Unity engine in the field of mobile games, in Unity's cloth implementation, Unity's cloth system is based on Nvidia's PhysX implementation, and a large number of packages have been carried out to shield internal details and simplify the use of cloth. Unity's cloth is encapsulated into a Component, and its usage is very simple: first, add a cloth component to the gameObject where the SkinnedMeshRenderer is located; then edit the properties of each vertex of the cloth, and adjust other properties and collider information in the cloth component; The effect is shown in Figure 3.
除了使用Unity自带的布料系统外,在Asset Store中还有其他的插件可以实现或接近动态布料的效果,如Dynamic Bone、Obi Cloth等,Obi Cloth是一款模拟布料的插件,核心的布料解算器用C++实现,其他部分用c#实现;Obi Cloth提供了丰富的布料特性和友好的布料编辑体验,使用起来也不太复杂,模拟效果也很不错,如图4所示,但其效率相比Unity自带的布料要低很多,而且与不同版本的Unity之间也有一些兼容问题,因此应用较为有限。In addition to using the cloth system that comes with Unity, there are other plug-ins in the Asset Store that can achieve or approach the effect of dynamic cloth, such as Dynamic Bone, Obi Cloth, etc. Obi Cloth is a plug-in for simulating cloth. The core cloth solution The calculator is implemented in C++, and other parts are implemented in C#; Obi Cloth provides rich cloth features and a friendly cloth editing experience. It is not too complicated to use, and the simulation effect is also very good, as shown in Figure 4, but its efficiency is compared to The cloth that comes with Unity is much lower, and there are some compatibility issues with different versions of Unity, so the application is more limited.
另外,移动平台上常用的Dynamic Bone插件也可在某些情况下来逼近布料效果,该插件是基于骨骼的物理模拟方法,将骨骼看作通过关节相连的链状结构,通过物理计算来模拟骨骼链的运动,然后通过Skin作用到模型的顶点。In addition, the Dynamic Bone plug-in commonly used on mobile platforms can also approximate the cloth effect in some cases. This plug-in is a physical simulation method based on bones. It regards bones as a chain-like structure connected by joints, and simulates bone chains through physical calculations. The motion is then applied to the vertices of the model through the Skin.
与Unity的布料相比,Dynamic Bone在效率上有着很大的优势,毕竟骨骼数量比模型顶点数少很多;对于飘带等细长状的模型,模拟起来的效果也不错。但毕竟DynamicBone是基于骨骼的,模拟效果显然不如基于顶点的布料精细,而且要让模型有动态效果,还必须为模型制作额外的骨骼和绑定。另外,由于其链状特性,往往只适用于长条状的布料模拟效果。而对于大片状的布料,就显得无能为力了,如图5所示,为了做出短裙的动态效果,使用Dynamic Bone的方案需要多条骨骼链才行,而这样的话,计算量也会大大增加。Compared with Unity's cloth, Dynamic Bone has a great advantage in efficiency. After all, the number of bones is much less than the number of model vertices; for slender models such as streamers, the simulation effect is also good. But after all DynamicBone is based on bones, the simulation effect is obviously not as fine as vertex-based cloth, and to make the model dynamic, additional bones and bindings must be made for the model. In addition, due to its chain-like nature, it is often only suitable for long strips of cloth simulation effects. For large pieces of fabric, it seems powerless. As shown in Figure 5, in order to create the dynamic effect of short skirts, the solution of using Dynamic Bone requires multiple bone chains, and in this case, the amount of calculation will also be large. Increase.
针对上述的问题,目前尚未提出有效的解决方案。For the above problems, no effective solution has been proposed yet.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种虚拟对象的渲染方法和装置、存储介质、电子装置,以至少解决相关技术中数据处理的效率较低的技术问题。Embodiments of the present application provide a method and device for rendering a virtual object, a storage medium, and an electronic device, so as to at least solve the technical problem of low data processing efficiency in the related art.
根据本申请实施例的一个方面,提供了一种虚拟对象的渲染方法,包括:获取第一模型和第二模型,其中,第一模型和第二模型用于表示虚拟场景中的目标对象,第一模型的面片精度低于第二模型的面片精度;通过物理引擎对第一模型进行模拟确定目标对象所处的目标姿态;利用第一模型中面片的顶点位置确定第二模型中面片的顶点位置,其中,第一模型中面片的顶点位置是第一模型处于目标姿态时的顶点位置;利用第二模型渲染出处于目标姿态的目标对象。According to an aspect of the embodiments of the present application, a method for rendering a virtual object is provided, including: acquiring a first model and a second model, wherein the first model and the second model are used to represent a target object in a virtual scene, and the first model and the second model are used to represent a target object in a virtual scene. The mesh accuracy of one model is lower than that of the second model; the first model is simulated by the physics engine to determine the target pose of the target object; the vertex position of the mesh in the first model is used to determine the surface in the second model The vertex position of the patch, wherein the vertex position of the patch in the first model is the vertex position when the first model is in the target posture; the target object in the target posture is rendered by using the second model.
根据本申请实施例的另一方面,还提供了一种虚拟对象的渲染装置,包括:获取单元,用于获取第一模型和第二模型,其中,第一模型和第二模型用于表示虚拟场景中的目标对象,第一模型的面片精度低于第二模型的面片精度;模拟单元,用于通过物理引擎对第一模型进行模拟确定目标对象所处的目标姿态;确定单元,用于利用第一模型中面片的顶点位置确定第二模型中面片的顶点位置,其中,第一模型中面片的顶点位置是第一模型处于目标姿态时的顶点位置;渲染单元,用于利用第二模型渲染出处于目标姿态的目标对象。According to another aspect of the embodiments of the present application, a device for rendering virtual objects is also provided, including: an acquiring unit, configured to acquire a first model and a second model, wherein the first model and the second model are used to represent virtual objects For the target object in the scene, the mesh accuracy of the first model is lower than that of the second model; the simulation unit is used for simulating the first model through the physics engine to determine the target posture of the target object; the determination unit is used for for determining the vertex position of the patch in the second model by using the vertex position of the patch in the first model, wherein the vertex position of the patch in the first model is the vertex position when the first model is in the target posture; the rendering unit is used for The target object in the target pose is rendered using the second model.
根据本申请实施例的另一方面,还提供了一种存储介质,该存储介质包括存储的程序,程序运行时执行上述的方法。According to another aspect of the embodiments of the present application, a storage medium is also provided, where the storage medium includes a stored program, and the above method is executed when the program runs.
根据本申请实施例的另一方面,还提供了一种电子装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器通过计算机程序执行上述的方法。According to another aspect of the embodiments of the present application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and running on the processor, where the processor executes the above method through the computer program.
在本申请实施例中,在模拟阶段利用第一模型这个低分辨率模型去模拟,在渲染阶段利用第二模型这个高分辨率模型去渲染,对结构复杂难以模拟的面片mesh,用简单的模型去模拟,用复杂的模型去渲染,而不是始终用复杂的模型去模拟和渲染,降低了物理模拟阶段的运算量,可以解决相关技术中数据处理的效率较低的技术问题,进而达到提高处理效率的技术效果。In the embodiment of the present application, the first model is used to simulate the low-resolution model in the simulation stage, and the high-resolution model of the second model is used to render in the rendering stage. Model to simulate, use complex models to render, rather than always use complex models to simulate and render, reduce the amount of calculation in the physical simulation stage, and can solve the technical problem of low data processing efficiency in related technologies, thereby improving The technical effect of processing efficiency.
附图说明Description of drawings
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The schematic embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the attached image:
图1是相关技术中的一种可选的虚拟对象的渲染效果的示意图;1 is a schematic diagram of a rendering effect of an optional virtual object in the related art;
图2是相关技术中的一种可选的弹簧质点模型的示意图;2 is a schematic diagram of an optional spring mass model in the related art;
图3是相关技术中的一种可选的虚拟对象的渲染效果的示意图;3 is a schematic diagram of a rendering effect of an optional virtual object in the related art;
图4是相关技术中的一种可选的虚拟对象的渲染效果的示意图;4 is a schematic diagram of a rendering effect of an optional virtual object in the related art;
图5是相关技术中的一种可选的虚拟对象的渲染效果的示意图;5 is a schematic diagram of a rendering effect of an optional virtual object in the related art;
图6是相关技术中的一种可选的虚拟对象渲染的测试结果的示意图;Fig. 6 is the schematic diagram of the test result of a kind of optional virtual object rendering in the related art;
图7是相关技术中的一种可选的虚拟对象渲染的测试结果的示意图;7 is a schematic diagram of a test result of an optional virtual object rendering in the related art;
图8是相关技术中的一种可选的虚拟对象渲染的测试结果的示意图;8 is a schematic diagram of a test result of an optional virtual object rendering in the related art;
图9是根据本申请实施例的虚拟对象的渲染方法的硬件环境的示意图;9 is a schematic diagram of a hardware environment of a method for rendering virtual objects according to an embodiment of the present application;
图10是根据本申请实施例的一种可选的虚拟对象的渲染方法的流程图;10 is a flowchart of an optional virtual object rendering method according to an embodiment of the present application;
图11是根据本申请实施例的虚拟对象的渲染效果的示意图;11 is a schematic diagram of a rendering effect of a virtual object according to an embodiment of the present application;
图12是根据本申请实施例的虚拟对象的面片的示意图;12 is a schematic diagram of a patch of a virtual object according to an embodiment of the present application;
图13是根据本申请实施例的虚拟对象的渲染方案的示意图;13 is a schematic diagram of a rendering scheme of a virtual object according to an embodiment of the present application;
图14是是根据本申请实施例的虚拟对象的渲染方案的示意图;14 is a schematic diagram of a rendering scheme of a virtual object according to an embodiment of the present application;
图15是根据本申请实施例的虚拟对象的渲染效果的示意图;15 is a schematic diagram of a rendering effect of a virtual object according to an embodiment of the present application;
图16是根据本申请实施例的虚拟对象渲染的测试结果的示意图;16 is a schematic diagram of a test result of virtual object rendering according to an embodiment of the present application;
图17是根据本申请实施例的虚拟对象渲染的测试结果的示意图;17 is a schematic diagram of a test result of virtual object rendering according to an embodiment of the present application;
图18是根据本申请实施例的一种可选的虚拟对象的渲染装置的示意图;以及,FIG. 18 is a schematic diagram of an optional virtual object rendering apparatus according to an embodiment of the present application; and,
图19是根据本申请实施例的一种终端的结构框图。FIG. 19 is a structural block diagram of a terminal according to an embodiment of the present application.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。In order to make those skilled in the art better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only The embodiments are part of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the scope of protection of the present application.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first", "second", etc. in the description and claims of the present application and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It is to be understood that data so used may be interchanged under appropriate circumstances so that the embodiments of the application described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having" and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those expressly listed Rather, those steps or units may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.
发明人经过对相关技术进行研究发现,虽然相关技术中布料的模拟效果很好,但是在游戏中效率问题是非常重要的,尤其是对于移动终端而言(受限于体积、电池等因素,硬件的性能并不如台式机设备),发明人测试了各种平台上不同顶点数的布料的运行效率,如图6至图8(图6是高通骁龙835平台的测试结果、图7是苹果A11处理器平台的测试结果、图8是英特尔i5-6500平台的测试结果)所示,在PC上模拟9块1000顶点的布料模拟总用时不到1ms,但在移动端,同样规模的布料模拟用时已经达到了5ms左右,这对于移动终端而言是一个很大的开销。当然,在移动平台上,当布料的顶点数限制在100这个量级上时,9块布料的开销也只是1ms左右,这就意味着布料完全可以放心使用了,但是此时的显示效果就会比较糟糕。After researching related technologies, the inventor found that although the simulation effect of cloth in related technologies is very good, the efficiency problem in games is very important, especially for mobile terminals (limited by factors such as volume, battery, hardware, etc.). The performance is not as good as that of desktop devices), the inventors tested the operating efficiency of fabrics with different vertices on various platforms, as shown in Figure 6 to Figure 8 (Figure 6 is the test result of the Qualcomm Snapdragon 835 platform, Figure 7 is the Apple A11 The test results of the processor platform (Figure 8 is the test results of the Intel i5-6500 platform) show that the total simulation time of 9 pieces of 1000-vertex cloth simulation on the PC is less than 1ms, but on the mobile terminal, the cloth simulation time of the same scale It has reached about 5ms, which is a large overhead for a mobile terminal. Of course, on a mobile platform, when the number of vertices of the cloth is limited to 100, the overhead of 9 pieces of cloth is only about 1ms, which means that the cloth can be used with confidence, but the display effect at this time will be worse.
基于上面的性能测试结论,为了在移动端可以用得起布料模拟,根据本申请实施例的一方面,提供了一种虚拟对象的渲染方法的方法实施例。本申请提供了一套兼具实现效果和实现效率的方案,该方案使用低精度的网格进行物理模拟计算,之后把动态效果应用到精细的网格模型上,这样就可以在降低性能消耗的同时添加布料模拟效果。Based on the above performance test conclusion, in order to be able to use cloth simulation at the mobile terminal, according to an aspect of the embodiments of the present application, a method embodiment of a method for rendering a virtual object is provided. This application provides a set of solutions with both realization effect and realization efficiency. The solution uses low-precision grids for physical simulation calculations, and then applies dynamic effects to fine grid models, so as to reduce performance consumption. Also add a cloth simulation effect.
可选地,在本实施例中,上述虚拟对象的渲染方法可以应用于如图9所示的由终端901和服务器903所构成的硬件环境中。如图9所示,服务器903通过网络与终端901进行连接,可用于为终端或终端上安装的客户端提供服务(如游戏服务等),可在服务器上或独立于服务器设置数据库905,用于为服务器903提供数据存储服务,上述网络包括但不限于:广域网、城域网或局域网,终端901并不限定于PC、手机、平板电脑等。Optionally, in this embodiment, the above-mentioned method for rendering virtual objects may be applied to a hardware environment composed of a terminal 901 and a server 903 as shown in FIG. 9 . As shown in FIG. 9 , the server 903 is connected to the terminal 901 through the network, which can be used to provide services (such as game services, etc.) for the terminal or the client installed on the terminal, and the database 905 can be set on the server or independently from the server, for To provide data storage service for the server 903, the above-mentioned network includes but is not limited to: a wide area network, a metropolitan area network or a local area network, and the terminal 901 is not limited to a PC, a mobile phone, a tablet computer, and the like.
本申请实施例的虚拟对象的渲染方法可以由终端901来执行,还可以是由服务器903和终端901共同执行。其中,终端901执行本申请实施例的虚拟对象的渲染方法也可以是由安装在其上的客户端来执行。图10是根据本申请实施例的一种可选的虚拟对象的渲染方法的流程图,如图10所示,该方法可以包括以下步骤:The rendering method of the virtual object in this embodiment of the present application may be executed by the terminal 901 , or may be executed jointly by the server 903 and the terminal 901 . Wherein, the terminal 901 may execute the rendering method of the virtual object according to the embodiment of the present application, and may also be executed by a client installed on the terminal 901 . FIG. 10 is a flowchart of an optional virtual object rendering method according to an embodiment of the present application. As shown in FIG. 10 , the method may include the following steps:
步骤S1002,终端获取第一模型和第二模型,第一模型和第二模型用于表示虚拟场景中的目标对象,第一模型的面片精度低于第二模型的面片精度。该终端即下文提及的为移动设备的目标终端。Step S1002, the terminal acquires a first model and a second model, the first model and the second model are used to represent the target object in the virtual scene, and the mesh precision of the first model is lower than that of the second model. The terminal is the target terminal of the mobile device mentioned below.
上述第一模型和第二模型都是用来描述目标对象的模型,二者的区别仅仅在于面片精度不同,如第一模型采用了N个面片,第二模型采用了M个面片,M大于N。The above-mentioned first model and second model are both models used to describe the target object. The difference between the two is only that the accuracy of the patches is different. For example, the first model adopts N patches, and the second model adopts M patches. M is greater than N.
步骤S1004,终端通过物理引擎对第一模型进行模拟确定目标对象所处的目标姿态。Step S1004, the terminal simulates the first model through the physics engine to determine the target posture of the target object.
现实世界中的所有物体会遵循自然界的定律,在游戏里中要想达到模拟现实世界的物理效果,就需要使用物理引擎作为辅助。游戏引擎中一般会内置物理引擎,通过物理引擎的处理能够使得游戏中的对象按照物理运动规律来进行运动,如被自然界的约束所作用,自然界的约束有重力、扭矩力、冲力,物体与物体之间可以有相互碰撞的作用力、摩擦力等。All objects in the real world will follow the laws of nature. In order to achieve the physical effect of simulating the real world in the game, you need to use a physics engine as an auxiliary. The game engine usually has a built-in physics engine. Through the processing of the physics engine, the objects in the game can move according to the laws of physical motion, such as being affected by the constraints of nature. The constraints of nature include gravity, torque, impulse, objects and objects. There can be mutual collision forces, frictional forces, etc.
步骤S1006,终端利用第一模型中面片的顶点位置确定第二模型中面片的顶点位置,第一模型中面片的顶点位置是第一模型处于目标姿态时的顶点位置。Step S1006, the terminal uses the vertex positions of the patches in the first model to determine the vertex positions of the patches in the second model, and the vertex positions of the patches in the first model are the vertex positions when the first model is in the target posture.
步骤S1008,终端利用第二模型渲染出处于目标姿态的目标对象。Step S1008, the terminal uses the second model to render the target object in the target posture.
在终端GPU渲染时,包括顶点处理、光栅化计算、纹理帖图、像素处理几个部分,GPU的工作就是完成3D图形的生成,将图形映射到相应的像素点上,对每个像素进行计算确定最终颜色并完成输出。When the terminal GPU renders, it includes vertex processing, rasterization calculation, texture mapping, and pixel processing. The GPU's job is to complete the generation of 3D graphics, map the graphics to the corresponding pixels, and calculate each pixel. Determine the final color and complete the output.
顶点处理:这阶段GPU读取描述3D图形外观的顶点数据(包括顶点位置)并根据顶点数据确定3D图形的形状及位置关系,建立起3D图形的骨架。这些工作由硬件实现的Vertex Shader(定点着色器)完成。Vertex processing: At this stage, the GPU reads the vertex data (including vertex positions) that describe the appearance of the 3D graphics, determines the shape and positional relationship of the 3D graphics according to the vertex data, and establishes the skeleton of the 3D graphics. These tasks are accomplished by hardware-implemented Vertex Shaders (fixed-point shaders).
光栅化计算:显示器实际显示的图像是由像素组成的,需要将上面生成的图形上的点和线通过一定的算法转换到相应的像素点。把一个矢量图形转换为一系列像素点的过程就称为光栅化。例如,一条数学表示的斜线段,最终被转化成阶梯状的连续像素点。Rasterization calculation: The image actually displayed by the monitor is composed of pixels, and the points and lines on the graphics generated above need to be converted to corresponding pixels through a certain algorithm. The process of converting a vector graphic into a series of pixels is called rasterization. For example, a mathematically represented oblique line segment is finally converted into a step-like continuous pixel point.
纹理帖图:顶点单元生成的多边形只构成了3D物体的轮廓,而纹理映射(texturemapping)工作完成对多变形表面的帖图,即将多边形的表面贴上相应的图片,从而生成“真实”的图形。TMU(Texture mapping unit)即是用来完成此项工作。Texture mapping: The polygons generated by the vertex unit only constitute the outline of the 3D object, and the texture mapping (texturemapping) work completes the mapping of the multi-deformable surface, that is, paste the corresponding image on the surface of the polygon to generate "real" graphics . TMU (Texture mapping unit) is used to complete this work.
像素处理:这阶段(在对每个像素进行光栅化处理期间)GPU完成对像素的计算和处理,从而确定每个像素的最终属性。这些工作由硬件实现的Pixel Shader(像素着色器)完成。最终输出:由ROP(光栅化引擎)最终完成像素的输出,1帧渲染完毕后,被送到显存帧缓冲区。Pixel processing: This stage (during the rasterization of each pixel) the GPU completes the computation and processing of the pixels to determine the final properties of each pixel. These tasks are done by the hardware-implemented Pixel Shader (pixel shader). Final output: The pixel output is finally completed by the ROP (rasterization engine), and after 1 frame is rendered, it is sent to the video memory frame buffer.
在本申请的方案中,在模拟阶段利用第一模型这个低分辨率模型去模拟,在渲染阶段利用第二模型这个高分辨率模型去渲染,对结构复杂难以模拟的面片mesh,用简单的模型去模拟,用复杂的模型去渲染,而不是始终用复杂的模型去模拟和渲染,降低了物理模拟阶段的运算量,可以解决相关技术中数据处理的效率较低的技术问题,进而达到提高处理效率的技术效果。In the solution of the present application, in the simulation stage, the low-resolution model of the first model is used to simulate, and in the rendering stage, the high-resolution model of the second model is used for rendering. Model to simulate, use complex models to render, rather than always use complex models to simulate and render, reduce the amount of calculation in the physical simulation stage, and can solve the technical problem of low data processing efficiency in related technologies, thereby improving The technical effect of processing efficiency.
在一个可选的实施例中,利用第一模型中面片的顶点位置确定第二模型中面片的顶点位置包括以下两种实现方案,第一种可以通过如下步骤11-步骤12实现:In an optional embodiment, using the vertex positions of the patches in the first model to determine the vertex positions of the patches in the second model includes the following two implementation solutions, the first one can be implemented through the following steps 11 to 12:
步骤11,查找第二模型中的目标顶点,目标顶点为第二模型中位于目标终端的当前展示区域内的顶点,目标终端用于控制虚拟场景中的玩家对象(可以为上述目标对象或者其他对象)。Step 11, find the target vertex in the second model, the target vertex is the vertex located in the current display area of the target terminal in the second model, and the target terminal is used to control the player object in the virtual scene (can be the above-mentioned target object or other objects. ).
步骤12,调用图形处理器,对第一模型中面片的顶点位置进行处理得到第二模型中目标顶点的顶点位置。Step 12: Invoke the graphics processor to process the vertex positions of the patches in the first model to obtain the vertex positions of the target vertexes in the second model.
可选地,调用图形处理器,对第一模型中面片的顶点位置进行处理得到第二模型中目标顶点的顶点位置包括如下步骤121-步骤122:Optionally, calling a graphics processor to process the vertex positions of the patches in the first model to obtain the vertex positions of the target vertices in the second model includes the following
步骤121,将第一模型中面片的顶点位置保存至目标缓存,如compute Buffer中,目标缓存是为图形处理器配置的用于保存待处理数据的缓存。Step 121: Save the vertex positions of the patches in the first model to a target buffer, such as a compute buffer, where the target buffer is a buffer configured for a graphics processor and used to save data to be processed.
步骤122,图形处理器从目标缓存读取第一模型中面片的顶点位置,并利用第一模型中面片的顶点位置确定第二模型中目标顶点的顶点位置。Step 122, the graphics processor reads the vertex positions of the patches in the first model from the target cache, and determines the vertex positions of the target vertexes in the second model by using the vertex positions of the patches in the first model.
在另一个可选的实施例中,利用第一模型中面片的顶点位置确定第二模型中面片的顶点位置的第二种可以通过如下步骤21-步骤22实现:In another optional embodiment, the second method of using the vertex positions of the patches in the first model to determine the vertex positions of the patches in the second model can be implemented through the following steps 21 to 22:
步骤21,查找第二模型中的多个目标顶点,目标顶点为第二模型中位于目标终端的当前展示区域内的顶点。Step 21: Search for multiple target vertices in the second model, where the target vertices are vertices in the second model that are located in the current display area of the target terminal.
步骤22,调用图形处理器,对第一模型中面片的顶点位置进行并行处理得到第二模型中多个目标顶点的顶点位置。Step 22: Invoke the graphics processor to perform parallel processing on the vertex positions of the patches in the first model to obtain the vertex positions of multiple target vertices in the second model.
可选地,调用图形处理器,对第一模型中面片的顶点位置进行并行处理得到第二模型中多个目标顶点的顶点位置包括如下步骤221-步骤222:Optionally, calling a graphics processor to perform parallel processing on the vertex positions of the patches in the first model to obtain the vertex positions of multiple target vertices in the second model includes the following steps 221 to 222:
步骤221,在图形处理器中创建多个第一线程,多个第一线程的线程数量和多个目标顶点的顶点数量相同。Step 221: Create multiple first threads in the graphics processor, and the number of threads of the multiple first threads is the same as the number of vertices of the multiple target vertices.
步骤222,通过多个第一线程对第一模型中面片的顶点位置进行并行处理得到第二模型中多个目标顶点的顶点位置,多个第一线程中的每个线程用于得到一个目标顶点的顶点位置,多个第一线程中任意两个线程得到的目标顶点的顶点位置不同,相当于第一线程和目标顶点是一一对应的关系。In step 222, the vertex positions of the patches in the first model are processed in parallel by multiple first threads to obtain the vertex positions of multiple target vertices in the second model, and each thread in the multiple first threads is used to obtain a target. For the vertex positions of the vertices, the vertex positions of the target vertices obtained by any two threads in the plurality of first threads are different, which is equivalent to a one-to-one correspondence between the first threads and the target vertices.
可选地,考虑到若每个目标顶点的顶点位置均调用一个线程来进行处理,会在短时间内占用GPU的大量资源,可以按照下述方式进行优化,调用图形处理器,对第一模型中面片的顶点位置进行并行处理得到第二模型中多个目标顶点的顶点位置包括如下步骤223-步骤224:Optionally, considering that if a thread is called for processing the vertex position of each target vertex, a large amount of GPU resources will be occupied in a short period of time, the optimization can be carried out in the following way, calling the graphics processor to perform the first model Performing parallel processing on the vertex positions of the mid-face to obtain the vertex positions of multiple target vertices in the second model includes the following steps 223 to 224:
步骤223,在图形处理器中创建多个第二线程,多个第二线程的线程数量少于多个目标顶点的顶点数量。Step 223: Create multiple second threads in the graphics processor, where the number of threads of the multiple second threads is less than the number of vertices of the multiple target vertices.
步骤224,通过多个第二线程对第一模型中面片的顶点位置进行并行处理得到第二模型中多个目标顶点的顶点位置,其中,多个第二线程中的每个线程用于得到至少一个目标顶点的顶点位置,多个第二线程中的部分或者全部线程用于在得到一个目标顶点的顶点位置之后,继续进行处理得到另一个目标顶点的顶点位置,相当于多个第二线程是并行运行的,但是,每个第二线程可以串行处理多个目标顶点。Step 224, performing parallel processing on the vertex positions of the patches in the first model by multiple second threads to obtain the vertex positions of multiple target vertices in the second model, wherein each thread in the multiple second threads is used to obtain The vertex position of at least one target vertex, and some or all of the multiple second threads are used to continue processing to obtain the vertex position of another target vertex after obtaining the vertex position of one target vertex, which is equivalent to multiple second threads are run in parallel, however, each second thread can process multiple target vertices serially.
在上述实现方案中,利用第一模型中面片的顶点位置确定第二模型中面片的顶点位置包括按照如下步骤31-步骤32所示的方式确定第二模型中每个待确认顶点的顶点位置:In the above implementation scheme, using the vertex positions of the patches in the first model to determine the vertex positions of the patches in the second model includes determining the vertex of each vertex to be confirmed in the second model in the manner shown in the following steps 31 to 32 Location:
步骤31,从第一模型中查找与第二模型中目标顶点关联的目标面片,目标顶点为第二模型中当前待确定顶点位置的顶点。Step 31: Search for a target patch associated with a target vertex in the second model from the first model, where the target vertex is a vertex whose position is currently to be determined in the second model.
步骤32,根据目标顶点与目标面片之间的关联关系和目标面片的所有顶点的顶点位置确定目标顶点的顶点位置。Step 32: Determine the vertex position of the target vertex according to the relationship between the target vertex and the target patch and the vertex positions of all vertices of the target patch.
在上述实施例中,目标面片为具有三个顶点的三角形面片,其中,根据目标顶点与目标面片之间的关联关系和目标面片的所有顶点的顶点位置确定目标顶点的顶点位置步骤321所示的坐标计算和步骤322所示的法线计算两个方面:In the above embodiment, the target patch is a triangular patch with three vertices, wherein the step of determining the vertex position of the target vertex is based on the relationship between the target vertex and the target patch and the vertex positions of all vertices of the target patch The coordinate calculation shown in 321 and the normal calculation shown in step 322 have two aspects:
步骤322,按照用于描述第一关系的如下公式确定目标顶点的顶点坐标P′:Step 322: Determine the vertex coordinate P′ of the target vertex according to the following formula for describing the first relationship:
其中,A为三角形面片的第一顶点的坐标,B为三角形面片的第二顶点的坐标,C为三角形面片的第三顶点的坐标,α、β、γ为设定的参数,表示从第一顶点到第二顶点的向量,表示从第一顶点到第三顶点的向量,表示对取范数,关联关系包括第一关系。 Among them, A is the coordinate of the first vertex of the triangular patch, B is the coordinate of the second vertex of the triangular patch, C is the coordinate of the third vertex of the triangular patch, α, β, γ are the set parameters, represents the vector from the first vertex to the second vertex, represents the vector from the first vertex to the third vertex, express right Taking the norm, the association relationship includes the first relationship.
步骤322,按照用于描述第二关系的如下公式确定目标顶点的顶点法线Step 322, determine the vertex normal of the target vertex according to the following formula for describing the second relationship
其中,表示三角形面片中第一顶点的顶点法线,表示三角形面片中第二顶点的顶点法线,表示三角形面片中第三顶点的顶点法线,α、β、γ为设定的参数,关联关系包括第二关系。 in, represents the vertex normal of the first vertex in the triangular patch, represents the vertex normal of the second vertex in the triangular patch, Indicates the vertex normal of the third vertex in the triangular patch, α, β, and γ are the set parameters, and the association relationship includes the second relationship.
作为一种可选的实施例,下文以将本申请的技术方案应用在UNITY引擎为例进行详述。该方案使用低精度的网格进行物理模拟计算,之后把动态效果应用到精细的网格模型上,这样就可以在降低性能消耗的同时添加布料模拟效果。As an optional embodiment, the following describes in detail by taking the application of the technical solution of the present application to the UNITY engine as an example. This scheme uses low-precision meshes for physical simulation calculations, and then applies dynamic effects to fine mesh models, so that cloth simulation effects can be added while reducing performance consumption.
这个方案可称为Adhere Cloth,其功能是让一个面片mesh跟随着布料一起运动,利用adhere cloth可以实现用低分辨率模型去模拟,高分辨率模型去渲染;对结构复杂难以模拟的mesh,用简单的模型去模拟,用复杂的模型去渲染。This solution can be called Adhere Cloth. Its function is to make a mesh move with the cloth. Using adhere cloth, it can be simulated with a low-resolution model and rendered with a high-resolution model. For meshes with complex structures that are difficult to simulate, Simulate with simple models and render with complex models.
如图11所示,可以把用于模拟的布料叫做base mesh(即第一模型),被驱动的mesh叫做Adhere Mesh(即第二模型)。如图12所示,在初始姿态时,Adhere Mesh中的每个点P都在base mesh里有一个对应的三角形(与P距离最近),点P可以用三角形ABC的质心坐标和点到三角形平面的距离(如Oh1、Oh2、Oh3)表示。将这些信息保存下来,那么在运行时AdhereMesh的顶点就可以由base mesh的顶点计算得到,P的法线也由对应三角形的顶点法线插值得到。As shown in Figure 11, the cloth used for the simulation can be called the base mesh (ie the first model), and the driven mesh is called the Adhere Mesh (ie the second model). As shown in Figure 12, at the initial attitude, each point P in the Adhere Mesh has a corresponding triangle in the base mesh (the closest distance to P). Point P can use the coordinates of the center of mass of the triangle ABC and the point to the triangle plane The distance (such as Oh1, Oh2, Oh3) is represented. Save this information, then the vertices of AdhereMesh can be calculated from the vertices of the base mesh at runtime, and the normal of P is also obtained by interpolation of the vertex normal of the corresponding triangle.
在计算时,对Adhere Mesh中的每个点P,遍历base mesh中所有的三角形,找到距离点P最近的三角形ABC,从点P向三角形ABC平面作垂线,交于点O,则O可以表示为:During the calculation, for each point P in the Adhere Mesh, traverse all the triangles in the base mesh, find the triangle ABC closest to the point P, draw a vertical line from the point P to the triangle ABC plane, and intersect at the point O, then O can be Expressed as:
记那么P就可以表示成:remember Then P can be expressed as:
把每个点对应的三角形中三个点的索引id1,id2,id3和1-α-β、α、β、γ保存下来供运行时使用。Save the indices id1, id2, id3 and 1-α-β, α, β, γ of the three points in the triangle corresponding to each point for runtime use.
获取物理模拟完成后的base mesh的顶点位置和法线,那么Adhere Mesh的顶点和法线可以从base mesh计算得到:Obtain the vertex positions and normals of the base mesh after the physical simulation is completed, then the vertices and normals of the Adhere Mesh can be calculated from the base mesh:
其中A、B、C分别是P对应三角形的顶点坐标。where A, B, and C are the vertex coordinates of the triangle corresponding to P, respectively.
在AdhereClothGPU的实现方案中,考虑到每帧都要对Adhere Mesh的每个顶点进行计算,计算量比较大,所以采用compute shader来加速计算过程。In the implementation scheme of AdhereClothGPU, considering that each vertex of the Adhere Mesh needs to be calculated every frame, the amount of calculation is relatively large, so the compute shader is used to speed up the calculation process.
如图13所示,可以把所有的计算放到OnWillRenderObject函数内,这样当布料在视野外就不需要再每帧计算。在OnWillRenderObject函数里首先从布料获取顶点,更新compute Buffer(即目标缓存);然后调用compute shader计算Adhere Mesh的顶点位置和法线,最后把得到的vertex buffer(即坐标)和normal buffer(即法线)设给Adhere Mesh的材质material,用来替换原来的顶点和法线。使用compute shader计算4000顶点的Adhere Mesh,CPU和GPU总用时约0.1ms,极大的改善了性能。As shown in Figure 13, all calculations can be placed in the OnWillRenderObject function, so that when the cloth is out of view, there is no need to calculate every frame. In the OnWillRenderObject function, first get the vertices from the cloth, update the compute Buffer (that is, the target buffer); then call the compute shader to calculate the vertex position and normal of the Adhere Mesh, and finally put the obtained vertex buffer (that is, coordinates) and normal buffer (that is, normals) ) is set to the material of the Adhere Mesh to replace the original vertices and normals. Using the compute shader to calculate the Adhere Mesh with 4000 vertices takes about 0.1ms in total on CPU and GPU, which greatly improves the performance.
虽然使用compute shader实现时的计算速度比较快,但是为了使用computeBuffer的数据进行渲染,需要对shader做额外的修改,在顶点着色器部分从StructuredBuffer里获取顶点和法线,而某些移动设备不支持此特性,所以本方案又实现了Adhere Cloth的Job System版本。Although the calculation speed is faster when using the compute shader, in order to use the data of the computeBuffer for rendering, additional modifications to the shader are required. The vertex and normal are obtained from the StructuredBuffer in the vertex shader part, and some mobile devices do not support it. This feature, so this solution implements the Job System version of Adhere Cloth.
AdhereClothJob采用了Job System和Burst Compiler来提高性能,每个Job执行一个Adhere Mesh的计算,在场景中有多个Adhere Mesh时可以并行计算。如图14所示,在update更新阶段获取base mesh的顶点、法线,然后调用Job(如Job1-Job3)进行计算;在LateUpdate阶段等待Job执行结束并取出计算得到的顶点和法线,调用Graphics.DrawMesh接口来执行最终的渲染。AdhereClothJob uses Job System and Burst Compiler to improve performance. Each Job performs the calculation of one Adhere Mesh, which can be calculated in parallel when there are multiple Adhere Meshes in the scene. As shown in Figure 14, in the update update phase, the vertices and normals of the base mesh are obtained, and then the Job (such as Job1-Job3) is called for calculation; in the LateUpdate phase, wait for the end of the Job execution and take out the calculated vertices and normals, and call Graphics .DrawMesh interface to perform the final rendering.
图15给出了应用了adhere Cloth和直接使用原始模型进行模拟(即cloth)的对比效果,可以看出,本申请的方案虽然较原始模型的精细度稍有下降,但Adhere Cloth依然可以保持不错的模拟效果。Figure 15 shows the comparison effect of applying Adhere Cloth and directly using the original model for simulation (ie, cloth). It can be seen that although the solution of this application is slightly less refined than the original model, Adhere Cloth can still maintain a good simulation effect.
本申请对直接使用布料和Adhere Cloth时的Runtime效率做了详细的对比,如图16和图17所示,这里布料的顶点数量为2501,低分辨率的布料顶点数量为121,AdhereGPU和AdhereJob的时间包括了布料模拟和adhere cloth插件计算的时间。首先在PC平台上测试,AdhereClothGPU和AdhereClothJob相对于布料都有很大提高,用时仅为布料的1/5左右;在移动平台测试(以高通835这个处理器为例)时,AdhereClothGPU无法使用,只能使用AdhereClothJob,相比直接使用布料,也有50%左右的提高。This application has made a detailed comparison of the runtime efficiency when using cloth and Adhere Cloth directly, as shown in Figure 16 and Figure 17, where the number of vertices of cloth is 2501, the number of vertices of low-resolution cloth is 121, and the number of vertices of AdhereGPU and AdhereJob is 2501. The time includes the time calculated by the cloth simulation and the adhere cloth plugin. First tested on the PC platform, AdhereClothGPU and AdhereClothJob are both greatly improved compared to cloth, and the time is only about 1/5 of the cloth; when tested on a mobile platform (using the Qualcomm 835 processor as an example), AdhereClothGPU cannot be used, only AdhereClothJob can be used, which is also improved by about 50% compared to using cloth directly.
在本申请的技术方案中,针对Unity布料在使用中的性能问题进行了测试与优化,实现了Unity中的Adhere Cloth插件。利用Adhere Cloth插件实现了布料上的LOD功能,提高布料实际应用时的性能,在实际项目中得到的应用效果非常好;目前Job System版本的AdhereCloth使用还是比较耗时,考虑到效率问题,在移动平台上使用布料最好还是直接使用低分辨率的布料模型,如果必须使用高分辨率模型,那么可以采用adhere cloth来提高效率。In the technical solution of the present application, the performance problem of Unity cloth in use is tested and optimized, and the Adhere Cloth plug-in in Unity is implemented. Using the Adhere Cloth plug-in to realize the LOD function on the cloth, improve the performance of the cloth in actual application, and the application effect obtained in the actual project is very good; the AdhereCloth of the current Job System version is still time-consuming to use. The best way to use cloth on the platform is to use a low-resolution cloth model directly. If you must use a high-resolution model, you can use adhere cloth to improve efficiency.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that, for the sake of simple description, the foregoing method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described action sequence. Because in accordance with the present application, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or in a part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, CD-ROM), including several instructions to make a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) execute the methods described in the various embodiments of this application.
根据本申请实施例的另一个方面,还提供了一种用于实施上述虚拟对象的渲染方法的虚拟对象的渲染装置。图18是根据本申请实施例的一种可选的虚拟对象的渲染装置的示意图,如图18所示,该装置可以包括:According to another aspect of the embodiments of the present application, a virtual object rendering apparatus for implementing the above virtual object rendering method is also provided. FIG. 18 is a schematic diagram of an optional virtual object rendering apparatus according to an embodiment of the present application. As shown in FIG. 18 , the apparatus may include:
获取单元1801,用于获取第一模型和第二模型,其中,所述第一模型和所述第二模型用于表示虚拟场景中的目标对象,所述第一模型的面片精度低于所述第二模型的面片精度;The obtaining unit 1801 is configured to obtain a first model and a second model, wherein the first model and the second model are used to represent the target object in the virtual scene, and the patch accuracy of the first model is lower than the the patch accuracy of the second model;
模拟单元1803,用于通过物理引擎对所述第一模型进行模拟确定所述目标对象所处的目标姿态;A simulation unit 1803, configured to simulate the first model through a physics engine to determine the target pose of the target object;
确定单元1805,用于利用所述第一模型中面片的顶点位置确定所述第二模型中面片的顶点位置,其中,所述第一模型中面片的顶点位置是所述第一模型处于所述目标姿态时的顶点位置;A determining unit 1805, configured to use the vertex positions of the patches in the first model to determine the vertex positions of the patches in the second model, wherein the vertex positions of the patches in the first model are the first model the vertex position when in the target pose;
渲染单元1807,用于利用所述第二模型渲染出处于所述目标姿态的所述目标对象。A rendering unit 1807, configured to render the target object in the target pose by using the second model.
需要说明的是,该实施例中的获取单元1801可以用于执行本申请实施例中的步骤S1002,该实施例中的模拟单元1803可以用于执行本申请实施例中的步骤S1004,该实施例中的确定单元1805可以用于执行本申请实施例中的步骤S1006,该实施例中的渲染单元1807可以用于执行本申请实施例中的步骤S1008。It should be noted that the acquiring unit 1801 in this embodiment may be used to perform step S1002 in this embodiment of the present application, and the simulation unit 1803 in this embodiment may be used to perform step S1004 in this embodiment of the present application. The determining unit 1805 in this embodiment may be configured to perform step S1006 in this embodiment of the present application, and the rendering unit 1807 in this embodiment may be configured to perform step S1008 in this embodiment of the present application.
此处需要说明的是,上述模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在如图9所示的硬件环境中,可以通过软件实现,也可以通过硬件实现。It should be noted here that the examples and application scenarios implemented by the foregoing modules and corresponding steps are the same, but are not limited to the contents disclosed in the foregoing embodiments. It should be noted that, as a part of the device, the above modules may run in the hardware environment as shown in FIG. 9 , and may be implemented by software or hardware.
通过上述模块,在模拟阶段利用第一模型这个低分辨率模型去模拟,在渲染阶段利用第二模型这个高分辨率模型去渲染,对结构复杂难以模拟的面片mesh,用简单的模型去模拟,用复杂的模型去渲染,而不是始终用复杂的模型去模拟和渲染,降低了物理模拟阶段的运算量,可以解决相关技术中数据处理的效率较低的技术问题,进而达到提高处理效率的技术效果。Through the above modules, the first model is used to simulate the low-resolution model in the simulation stage, and the high-resolution model of the second model is used to render in the rendering stage. For the meshes with complex structures that are difficult to simulate, simple models are used to simulate , Use complex models to render, instead of always using complex models to simulate and render, reduce the amount of calculation in the physical simulation stage, and solve the technical problem of low data processing efficiency in related technologies, thereby improving processing efficiency. technical effect.
可选地,所述确定单元包括:第一查找模块,用于从所述第一模型中查找与所述第二模型中目标顶点关联的目标面片,其中,所述目标顶点为所述第二模型中当前待确定顶点位置的顶点;第一确定模块,用于根据所述目标顶点与所述目标面片之间的关联关系和所述目标面片的所有顶点的顶点位置确定所述目标顶点的顶点位置。Optionally, the determining unit includes: a first search module, configured to search for a target patch associated with a target vertex in the second model from the first model, wherein the target vertex is the first The vertex whose position is currently to be determined in the second model; the first determination module is configured to determine the target according to the relationship between the target vertex and the target patch and the vertex positions of all vertices of the target patch The vertex position of the vertex.
可选地,所述目标面片为具有三个顶点的三角形面片,其中,所述确定模块还用于:Optionally, the target patch is a triangular patch with three vertices, wherein the determining module is further configured to:
按照用于描述第一关系的如下公式确定所述目标顶点的顶点坐标P′:The vertex coordinates P′ of the target vertex are determined according to the following formula for describing the first relationship:
其中,A为所述三角形面片的第一顶点的坐标,B为所述三角形面片的第二顶点的坐标,C为所述三角形面片的第三顶点的坐标,α、β、γ为设定的参数,表示从第一顶点到第二顶点的向量,表示从第一顶点到第三顶点的向量,表示对取范数,所述关联关系包括所述第一关系。 Among them, A is the coordinate of the first vertex of the triangular patch, B is the coordinate of the second vertex of the triangular patch, C is the coordinate of the third vertex of the triangular patch, α, β, γ are set parameters, represents the vector from the first vertex to the second vertex, represents the vector from the first vertex to the third vertex, express right Taking a norm, the association relationship includes the first relationship.
可选地,所述目标面片为具有三个顶点的三角形面片,其中,所述确定模块还用于:Optionally, the target patch is a triangular patch with three vertices, wherein the determining module is further configured to:
按照用于描述第二关系的如下公式确定所述目标顶点的顶点法线The vertex normal of the target vertex is determined according to the following formula for describing the second relationship
其中,表示所述三角形面片中第一顶点的顶点法线,表示所述三角形面片中第二顶点的顶点法线,表示所述三角形面片中第三顶点的顶点法线,α、β、γ为设定的参数,所述关联关系包括所述第二关系。 in, represents the vertex normal of the first vertex in the triangular patch, represents the vertex normal of the second vertex in the triangular patch, Indicates the vertex normal of the third vertex in the triangular patch, α, β, and γ are set parameters, and the association relationship includes the second relationship.
可选地,所述确定单元包括:第二查找模块,用于查找所述第二模型中的目标顶点,其中,所述目标顶点为所述第二模型中位于目标终端的当前展示区域内的顶点,所述目标终端用于控制所述虚拟场景中的对象;第二确定模块,用于调用图形处理器,对所述第一模型中面片的顶点位置进行处理得到所述第二模型中目标顶点的顶点位置。Optionally, the determining unit includes: a second search module, configured to search for a target vertex in the second model, wherein the target vertex is a target vertex located in the current display area of the target terminal in the second model. vertices, the target terminal is used to control the objects in the virtual scene; the second determination module is used to call the graphics processor to process the vertex positions of the patches in the first model to obtain the vertices in the second model The vertex position of the target vertex.
可选地,所述第二确定模块还用于:将所述第一模型中面片的顶点位置保存至目标缓存,其中,所述目标缓存是为所述图形处理器配置的用于保存待处理数据的缓存;所述图形处理器从所述目标缓存读取所述第一模型中面片的顶点位置,并利用所述第一模型中面片的顶点位置确定所述第二模型中目标顶点的顶点位置。Optionally, the second determination module is further configured to: save the vertex positions of the patches in the first model to a target cache, wherein the target cache is configured for the graphics processor to save the A cache for processing data; the graphics processor reads the vertex positions of the patches in the first model from the target cache, and uses the vertex positions of the patches in the first model to determine the target in the second model The vertex position of the vertex.
可选地,所述确定单元包括:第三查找模块,用于查找所述第二模型中的多个目标顶点,其中,所述目标顶点为所述第二模型中位于目标终端的当前展示区域内的顶点;第三确定模块,用于调用图形处理器,对所述第一模型中面片的顶点位置进行并行处理得到所述第二模型中所述多个目标顶点的顶点位置。Optionally, the determining unit includes: a third searching module, configured to search for multiple target vertices in the second model, wherein the target vertices are the current display area located in the target terminal in the second model The third determining module is used to call the graphics processor to perform parallel processing on the vertex positions of the patches in the first model to obtain the vertex positions of the multiple target vertices in the second model.
可选地,所述第三确定模块还用于:在所述图形处理器中创建多个第一线程,其中,所述多个第一线程的线程数量和所述多个目标顶点的顶点数量相同;通过所述多个第一线程对所述第一模型中面片的顶点位置进行并行处理得到所述第二模型中所述多个目标顶点的顶点位置,其中,所述多个第一线程中的每个线程用于得到一个所述目标顶点的顶点位置,所述多个第一线程中任意两个线程得到的所述目标顶点的顶点位置不同。Optionally, the third determining module is further configured to: create multiple first threads in the graphics processor, wherein the number of threads of the multiple first threads and the number of vertices of the multiple target vertices are the same; the vertex positions of the multiple target vertices in the second model are obtained by performing parallel processing on the vertex positions of the patches in the first model by the multiple first threads, wherein the multiple first Each of the threads is used to obtain a vertex position of the target vertex, and the vertex positions of the target vertex obtained by any two threads of the plurality of first threads are different.
可选地,所述第三确定模块还用于:在所述图形处理器中创建多个第二线程,其中,所述多个第二线程的线程数量少于所述多个目标顶点的顶点数量;通过所述多个第二线程对所述第一模型中面片的顶点位置进行并行处理得到所述第二模型中所述多个目标顶点的顶点位置,其中,所述多个第二线程中的每个线程用于得到至少一个所述目标顶点的顶点位置,所述多个第二线程中的每个线程用于在得到一个所述目标顶点的顶点位置之后,继续进行处理得到另一个所述目标顶点的顶点位置。Optionally, the third determining module is further configured to: create multiple second threads in the graphics processor, wherein the number of threads of the multiple second threads is less than the number of vertices of the multiple target vertices number; the vertex positions of the plurality of target vertices in the second model are obtained by performing parallel processing on the vertex positions of the patches in the first model by the plurality of second threads, wherein the plurality of second Each thread in the threads is used to obtain the vertex position of at least one of the target vertexes, and each thread of the plurality of second threads is used to continue processing to obtain another vertex position after obtaining the vertex position of one of the target vertexes. A vertex position of the target vertex.
虽然相关技术中布料的模拟效果很好,但是在游戏中效率问题是非常重要的,尤其是对于移动终端而言(受限于体积、电池等因素,硬件的性能并不如台式机设备),为了在移动端可以用得起布料模拟,根据本申请实施例的一方面,提供了一种虚拟对象的渲染方法的方法实施例。本申请提供了一套兼具实现效果和实现效率的方案,该方案使用低精度的网格进行物理模拟计算,之后把动态效果应用到精细的网格模型上,这样就可以在降低性能消耗的同时添加布料模拟效果。Although the simulation effect of cloth in the related art is very good, the problem of efficiency in games is very important, especially for mobile terminals (limited by factors such as volume, battery, etc., the performance of hardware is not as good as that of desktop devices), in order to Cloth simulation can be used at the mobile terminal. According to an aspect of the embodiments of the present application, a method embodiment of a method for rendering a virtual object is provided. This application provides a set of solutions with both realization effect and realization efficiency. The solution uses low-precision grids for physical simulation calculations, and then applies dynamic effects to fine grid models, so as to reduce performance consumption. Also add a cloth simulation effect.
在本申请的技术方案中,针对Unity布料在使用中的性能问题进行了测试与优化,实现了Unity中的Adhere Cloth插件。利用Adhere Cloth插件实现了布料上的LOD功能,提高布料实际应用时的性能,在实际项目中得到的应用效果非常好;目前Job System版本的AdhereCloth使用还是比较耗时,考虑到效率问题,在移动平台上使用布料最好还是直接使用低分辨率的布料模型,如果必须使用高分辨率模型,那么可以采用adhere cloth来提高效率。In the technical solution of the present application, the performance problem of Unity cloth in use is tested and optimized, and the Adhere Cloth plug-in in Unity is implemented. Using the Adhere Cloth plug-in to realize the LOD function on the cloth, improve the performance of the cloth in actual application, and the application effect obtained in the actual project is very good; the AdhereCloth of the current Job System version is still time-consuming to use. The best way to use cloth on the platform is to use a low-resolution cloth model directly. If you must use a high-resolution model, you can use adhere cloth to improve efficiency.
此处需要说明的是,上述模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在如图9所示的硬件环境中,可以通过软件实现,也可以通过硬件实现,其中,硬件环境包括网络环境。It should be noted here that the examples and application scenarios implemented by the foregoing modules and corresponding steps are the same, but are not limited to the contents disclosed in the foregoing embodiments. It should be noted that, as a part of the device, the above modules may run in the hardware environment as shown in FIG. 9 , and may be implemented by software or hardware, wherein the hardware environment includes a network environment.
根据本申请实施例的另一个方面,还提供了一种用于实施上述虚拟对象的渲染方法的服务器或终端。According to another aspect of the embodiments of the present application, there is also provided a server or terminal for implementing the above method for rendering a virtual object.
图19是根据本申请实施例的一种终端的结构框图,如图19所示,该终端可以包括:一个或多个(图19中仅示出一个)处理器1901、存储器1903、以及传输装置1905,如图19所示,该终端还可以包括输入输出设备1907。FIG. 19 is a structural block diagram of a terminal according to an embodiment of the present application. As shown in FIG. 19 , the terminal may include: one or more (only one is shown in FIG. 19 ) a processor 1901 , a
其中,存储器1903可用于存储软件程序以及模块,如本申请实施例中的虚拟对象的渲染方法和装置对应的程序指令/模块,处理器1901通过运行存储在存储器1903内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的虚拟对象的渲染方法。存储器1903可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器1903可进一步包括相对于处理器1901远程设置的存储器,这些远程存储器可以通过网络连接至终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The
上述的传输装置1905用于经由一个网络接收或者发送数据,还可以用于处理器与存储器之间的数据传输。上述的网络具体实例可包括有线网络及无线网络。在一个实例中,传输装置1905包括一个网络适配器(Network Interface Controller,NIC),其可通过网线与其他网络设备与路由器相连从而可与互联网或局域网进行通讯。在一个实例中,传输装置1905为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。The above-mentioned
其中,具体地,存储器1903用于存储应用程序。Specifically, the
处理器1901可以通过传输装置1905调用存储器1903存储的应用程序,以执行下述步骤:The processor 1901 can call the application program stored in the
获取第一模型和第二模型,其中,所述第一模型和所述第二模型用于表示虚拟场景中的目标对象,所述第一模型的面片精度低于所述第二模型的面片精度;Acquire a first model and a second model, wherein the first model and the second model are used to represent the target object in the virtual scene, and the surface accuracy of the first model is lower than that of the second model slice accuracy;
通过物理引擎对所述第一模型进行模拟确定所述目标对象所处的目标姿态;The first model is simulated by a physics engine to determine the target pose of the target object;
利用所述第一模型中面片的顶点位置确定所述第二模型中面片的顶点位置,其中,所述第一模型中面片的顶点位置是所述第一模型处于所述目标姿态时的顶点位置;The vertex position of the patch in the second model is determined by using the vertex position of the patch in the first model, wherein the vertex position of the patch in the first model is when the first model is in the target pose the vertex position;
利用所述第二模型渲染出处于所述目标姿态的所述目标对象。The target object in the target pose is rendered using the second model.
处理器1901还用于执行下述步骤:The processor 1901 is further configured to perform the following steps:
在所述图形处理器中创建多个第一线程,其中,所述多个第一线程的线程数量和所述多个目标顶点的顶点数量相同;creating a plurality of first threads in the graphics processor, wherein the number of threads of the plurality of first threads is the same as the number of vertices of the plurality of target vertices;
通过所述多个第一线程对所述第一模型中面片的顶点位置进行并行处理得到所述第二模型中所述多个目标顶点的顶点位置,其中,所述多个第一线程中的每个线程用于得到一个所述目标顶点的顶点位置,所述多个第一线程中任意两个线程得到的所述目标顶点的顶点位置不同。The vertex positions of the multiple target vertices in the second model are obtained by performing parallel processing on the vertex positions of the patches in the first model by the multiple first threads, wherein the multiple first threads Each of the threads is used to obtain a vertex position of the target vertex, and the vertex positions of the target vertex obtained by any two threads in the plurality of first threads are different.
处理器1901还用于执行下述步骤:The processor 1901 is further configured to perform the following steps:
在所述图形处理器中创建多个第二线程,其中,所述多个第二线程的线程数量少于所述多个目标顶点的顶点数量;creating a plurality of second threads in the graphics processor, wherein the number of threads of the plurality of second threads is less than the number of vertices of the plurality of target vertices;
通过所述多个第二线程对所述第一模型中面片的顶点位置进行并行处理得到所述第二模型中所述多个目标顶点的顶点位置,其中,所述多个第二线程中的每个线程用于得到至少一个所述目标顶点的顶点位置,所述多个第二线程中的每个线程用于在得到一个所述目标顶点的顶点位置之后,继续进行处理得到另一个所述目标顶点的顶点位置。The vertex positions of the multiple target vertices in the second model are obtained by performing parallel processing on the vertex positions of the patches in the first model by the multiple second threads, wherein the multiple second threads Each of the threads is used to obtain the vertex position of at least one of the target vertexes, and each thread of the plurality of second threads is used to continue processing to obtain another vertex position of the target vertex after obtaining the vertex position of one of the target vertexes. Describe the vertex position of the target vertex.
采用本申请实施例,提供了一种“获取第一模型和第二模型,其中,所述第一模型和所述第二模型用于表示虚拟场景中的目标对象,所述第一模型的面片精度低于所述第二模型的面片精度;通过物理引擎对所述第一模型进行模拟确定所述目标对象所处的目标姿态;利用所述第一模型中面片的顶点位置确定所述第二模型中面片的顶点位置,其中,所述第一模型中面片的顶点位置是所述第一模型处于所述目标姿态时的顶点位置;利用所述第二模型渲染出处于所述目标姿态的所述目标对象”的方案。在模拟阶段利用第一模型这个低分辨率模型去模拟,在渲染阶段利用第二模型这个高分辨率模型去渲染,对结构复杂难以模拟的面片mesh,用简单的模型去模拟,用复杂的模型去渲染,而不是始终用复杂的模型去模拟和渲染,降低了物理模拟阶段的运算量,可以解决相关技术中数据处理的效率较低的技术问题,进而达到提高处理效率的技术效果。Using the embodiments of the present application, there is provided a method of "acquiring a first model and a second model, wherein the first model and the second model are used to represent target objects in a virtual scene, and the surface of the first model is The patch accuracy is lower than the patch accuracy of the second model; the first model is simulated by a physics engine to determine the target pose of the target object; the vertex positions of the patches in the first model are used to determine the target pose. The vertex position of the patch in the second model, wherein the vertex position of the patch in the first model is the vertex position when the first model is in the target attitude; The target object in the target pose" scheme. In the simulation stage, use the low-resolution model of the first model to simulate, and use the high-resolution model of the second model to render in the rendering stage. Instead of using complex models to simulate and render all the time, it reduces the amount of computation in the physical simulation stage, and can solve the technical problem of low data processing efficiency in related technologies, thereby achieving the technical effect of improving processing efficiency.
可选地,本实施例中的具体示例可以参考上述实施例中所描述的示例,本实施例在此不再赘述。Optionally, for specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments, and details are not described herein again in this embodiment.
本领域普通技术人员可以理解,图19所示的结构仅为示意,终端可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile InternetDevices,MID)、PAD等终端设备。图19其并不对上述电子装置的结构造成限定。例如,终端还可包括比图19中所示更多或者更少的组件(如网络接口、显示装置等),或者具有与图19所示不同的配置。Those of ordinary skill in the art can understand that the structure shown in FIG. 19 is for illustration only, and the terminal can be a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, a palmtop computer, and a mobile Internet Device (Mobile Internet Devices, MID), PAD and other terminal equipment. FIG. 19 does not limit the structure of the above electronic device. For example, the terminal may also include more or less components than those shown in FIG. 19 (eg, network interface, display device, etc.), or have a different configuration than that shown in FIG. 19 .
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(RandomAccess Memory,RAM)、磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium can Including: flash disk, read-only memory (Read-Only Memory, ROM), random access device (RandomAccess Memory, RAM), magnetic disk or optical disk, etc.
本申请的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以用于执行虚拟对象的渲染方法的程序代码。Embodiments of the present application also provide a storage medium. Optionally, in this embodiment, the above-mentioned storage medium may be used to execute the program code of the method for rendering virtual objects.
可选地,在本实施例中,上述存储介质可以位于上述实施例所示的网络中的多个网络设备中的至少一个网络设备上。Optionally, in this embodiment, the foregoing storage medium may be located on at least one network device among multiple network devices in the network shown in the foregoing embodiment.
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps:
获取第一模型和第二模型,其中,所述第一模型和所述第二模型用于表示虚拟场景中的目标对象,所述第一模型的面片精度低于所述第二模型的面片精度;Acquire a first model and a second model, wherein the first model and the second model are used to represent the target object in the virtual scene, and the surface accuracy of the first model is lower than that of the second model slice accuracy;
通过物理引擎对所述第一模型进行模拟确定所述目标对象所处的目标姿态;The first model is simulated by a physics engine to determine the target pose of the target object;
利用所述第一模型中面片的顶点位置确定所述第二模型中面片的顶点位置,其中,所述第一模型中面片的顶点位置是所述第一模型处于所述目标姿态时的顶点位置;The vertex position of the patch in the second model is determined by using the vertex position of the patch in the first model, wherein the vertex position of the patch in the first model is when the first model is in the target pose the vertex position of ;
利用所述第二模型渲染出处于所述目标姿态的所述目标对象。The target object in the target pose is rendered using the second model.
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:Optionally, the storage medium is further configured to store program codes for performing the following steps:
在所述图形处理器中创建多个第一线程,其中,所述多个第一线程的线程数量和所述多个目标顶点的顶点数量相同;creating a plurality of first threads in the graphics processor, wherein the number of threads of the plurality of first threads is the same as the number of vertices of the plurality of target vertices;
通过所述多个第一线程对所述第一模型中面片的顶点位置进行并行处理得到所述第二模型中所述多个目标顶点的顶点位置,其中,所述多个第一线程中的每个线程用于得到一个所述目标顶点的顶点位置,所述多个第一线程中任意两个线程得到的所述目标顶点的顶点位置不同。The vertex positions of the multiple target vertices in the second model are obtained by performing parallel processing on the vertex positions of the patches in the first model by the multiple first threads, wherein the multiple first threads Each of the threads is used to obtain a vertex position of the target vertex, and the vertex positions of the target vertex obtained by any two threads in the plurality of first threads are different.
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:Optionally, the storage medium is further configured to store program codes for performing the following steps:
在所述图形处理器中创建多个第二线程,其中,所述多个第二线程的线程数量少于所述多个目标顶点的顶点数量;creating a plurality of second threads in the graphics processor, wherein the number of threads of the plurality of second threads is less than the number of vertices of the plurality of target vertices;
通过所述多个第二线程对所述第一模型中面片的顶点位置进行并行处理得到所述第二模型中所述多个目标顶点的顶点位置,其中,所述多个第二线程中的每个线程用于得到至少一个所述目标顶点的顶点位置,所述多个第二线程中的每个线程用于在得到一个所述目标顶点的顶点位置之后,继续进行处理得到另一个所述目标顶点的顶点位置。The vertex positions of the multiple target vertices in the second model are obtained by performing parallel processing on the vertex positions of the patches in the first model by the multiple second threads, wherein the multiple second threads Each of the threads is used to obtain the vertex position of at least one of the target vertexes, and each thread of the plurality of second threads is used to continue processing to obtain another vertex position of the target vertex after obtaining the vertex position of one of the target vertexes. Describe the vertex position of the target vertex.
可选地,本实施例中的具体示例可以参考上述实施例中所描述的示例,本实施例在此不再赘述。Optionally, for specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments, and details are not described herein again in this embodiment.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic Various media that can store program codes, such as discs or optical discs.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
上述实施例中的集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在上述计算机可读取的存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在存储介质中,包括若干指令用以使得一台或多台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。If the integrated units in the above-mentioned embodiments are implemented in the form of software functional units and sold or used as independent products, they may be stored in the above-mentioned computer-readable storage medium. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art, or all or part of the technical solution, and the computer software product is stored in a storage medium, Several instructions are included to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的客户端,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed client may be implemented in other manners. The apparatus embodiments described above are only illustrative, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components may be combined or Integration into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of units or modules, and may be in electrical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。The above are only the preferred embodiments of the present application. It should be pointed out that for those skilled in the art, without departing from the principles of the present application, several improvements and modifications can also be made. It should be regarded as the protection scope of this application.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010583263.5ACN111773719B (en) | 2020-06-23 | 2020-06-23 | Virtual object rendering method and device, storage medium, and electronic device |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010583263.5ACN111773719B (en) | 2020-06-23 | 2020-06-23 | Virtual object rendering method and device, storage medium, and electronic device |
| Publication Number | Publication Date |
|---|---|
| CN111773719Atrue CN111773719A (en) | 2020-10-16 |
| CN111773719B CN111773719B (en) | 2025-03-14 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010583263.5AActiveCN111773719B (en) | 2020-06-23 | 2020-06-23 | Virtual object rendering method and device, storage medium, and electronic device |
| Country | Link |
|---|---|
| CN (1) | CN111773719B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112200895A (en)* | 2020-12-07 | 2021-01-08 | 江苏原力数字科技股份有限公司 | Digital human cloth real-time resolving method based on deep learning |
| CN113706681A (en)* | 2021-07-30 | 2021-11-26 | 华为技术有限公司 | Image processing method and electronic device |
| CN113706683A (en)* | 2021-08-06 | 2021-11-26 | 网易(杭州)网络有限公司 | Shadow processing method and device of virtual three-dimensional model and electronic device |
| CN113919077A (en)* | 2021-10-29 | 2022-01-11 | 北京赛目科技有限公司 | Method and device for determining position information of vertex of patch and electronic equipment |
| CN114053696A (en)* | 2021-11-15 | 2022-02-18 | 完美世界(北京)软件科技发展有限公司 | Image rendering processing method and device and electronic equipment |
| CN114299200A (en)* | 2021-12-31 | 2022-04-08 | 网易(杭州)网络有限公司 | Cloth animation processing method and device, electronic device, storage medium |
| CN114401423A (en)* | 2022-01-13 | 2022-04-26 | 上海哔哩哔哩科技有限公司 | Data processing method and device |
| CN113919077B (en)* | 2021-10-29 | 2025-10-10 | 北京赛目科技有限公司 | Method, device and electronic device for determining position information of facet vertices |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101140663A (en)* | 2007-10-16 | 2008-03-12 | 中国科学院计算技术研究所 | A clothing animation calculation method |
| CN107358649A (en)* | 2017-06-07 | 2017-11-17 | 腾讯科技(深圳)有限公司 | The treating method and apparatus of terrain file |
| CN107393019A (en)* | 2017-07-31 | 2017-11-24 | 天堃众联科技(深圳)有限公司 | A kind of cloth simulation method and apparatus based on particle |
| US10022628B1 (en)* | 2015-03-31 | 2018-07-17 | Electronic Arts Inc. | System for feature-based motion adaptation |
| CN109087369A (en)* | 2018-06-22 | 2018-12-25 | 腾讯科技(深圳)有限公司 | Virtual objects display methods, device, electronic device and storage medium |
| CN109377542A (en)* | 2018-09-28 | 2019-02-22 | 国网辽宁省电力有限公司锦州供电公司 | 3D model rendering method, device and electronic device |
| CN109364486A (en)* | 2018-10-30 | 2019-02-22 | 网易(杭州)网络有限公司 | The method and device of HDR rendering, electronic equipment, storage medium in game |
| CN109448099A (en)* | 2018-09-21 | 2019-03-08 | 腾讯科技(深圳)有限公司 | Rendering method, device, storage medium and the electronic device of picture |
| CN109671141A (en)* | 2018-11-21 | 2019-04-23 | 深圳市腾讯信息技术有限公司 | The rendering method and device of image, storage medium, electronic device |
| CN109976827A (en)* | 2019-03-08 | 2019-07-05 | 北京邮电大学 | Loading method, server and the terminal of model |
| CN110286960A (en)* | 2019-06-27 | 2019-09-27 | 北京金山安全软件有限公司 | Image file loading method and device, electronic equipment and storage medium |
| CN110570507A (en)* | 2019-09-11 | 2019-12-13 | 珠海金山网络游戏科技有限公司 | Image rendering method and device |
| CN110694276A (en)* | 2019-10-14 | 2020-01-17 | 北京代码乾坤科技有限公司 | Physical effect simulation method, physical effect simulation device, storage medium, processor, and electronic device |
| CN111028320A (en)* | 2019-12-11 | 2020-04-17 | 腾讯科技(深圳)有限公司 | Cloth animation generation method and device and computer readable storage medium |
| CN111145326A (en)* | 2019-12-26 | 2020-05-12 | 网易(杭州)网络有限公司 | Processing method of three-dimensional virtual cloud model, storage medium, processor and electronic device |
| CN111167120A (en)* | 2019-12-31 | 2020-05-19 | 网易(杭州)网络有限公司 | Method and device for processing virtual model in game |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101140663A (en)* | 2007-10-16 | 2008-03-12 | 中国科学院计算技术研究所 | A clothing animation calculation method |
| US10022628B1 (en)* | 2015-03-31 | 2018-07-17 | Electronic Arts Inc. | System for feature-based motion adaptation |
| CN107358649A (en)* | 2017-06-07 | 2017-11-17 | 腾讯科技(深圳)有限公司 | The treating method and apparatus of terrain file |
| CN107393019A (en)* | 2017-07-31 | 2017-11-24 | 天堃众联科技(深圳)有限公司 | A kind of cloth simulation method and apparatus based on particle |
| CN109087369A (en)* | 2018-06-22 | 2018-12-25 | 腾讯科技(深圳)有限公司 | Virtual objects display methods, device, electronic device and storage medium |
| CN109448099A (en)* | 2018-09-21 | 2019-03-08 | 腾讯科技(深圳)有限公司 | Rendering method, device, storage medium and the electronic device of picture |
| CN109377542A (en)* | 2018-09-28 | 2019-02-22 | 国网辽宁省电力有限公司锦州供电公司 | 3D model rendering method, device and electronic device |
| CN109364486A (en)* | 2018-10-30 | 2019-02-22 | 网易(杭州)网络有限公司 | The method and device of HDR rendering, electronic equipment, storage medium in game |
| CN109671141A (en)* | 2018-11-21 | 2019-04-23 | 深圳市腾讯信息技术有限公司 | The rendering method and device of image, storage medium, electronic device |
| CN109976827A (en)* | 2019-03-08 | 2019-07-05 | 北京邮电大学 | Loading method, server and the terminal of model |
| CN110286960A (en)* | 2019-06-27 | 2019-09-27 | 北京金山安全软件有限公司 | Image file loading method and device, electronic equipment and storage medium |
| CN110570507A (en)* | 2019-09-11 | 2019-12-13 | 珠海金山网络游戏科技有限公司 | Image rendering method and device |
| CN110694276A (en)* | 2019-10-14 | 2020-01-17 | 北京代码乾坤科技有限公司 | Physical effect simulation method, physical effect simulation device, storage medium, processor, and electronic device |
| CN111028320A (en)* | 2019-12-11 | 2020-04-17 | 腾讯科技(深圳)有限公司 | Cloth animation generation method and device and computer readable storage medium |
| CN111145326A (en)* | 2019-12-26 | 2020-05-12 | 网易(杭州)网络有限公司 | Processing method of three-dimensional virtual cloud model, storage medium, processor and electronic device |
| CN111167120A (en)* | 2019-12-31 | 2020-05-19 | 网易(杭州)网络有限公司 | Method and device for processing virtual model in game |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112200895A (en)* | 2020-12-07 | 2021-01-08 | 江苏原力数字科技股份有限公司 | Digital human cloth real-time resolving method based on deep learning |
| CN112200895B (en)* | 2020-12-07 | 2021-04-16 | 江苏原力数字科技股份有限公司 | Digital human cloth real-time resolving method based on deep learning |
| CN113706681A (en)* | 2021-07-30 | 2021-11-26 | 华为技术有限公司 | Image processing method and electronic device |
| CN113706683B (en)* | 2021-08-06 | 2023-09-26 | 网易(杭州)网络有限公司 | Shadow processing method and device for virtual three-dimensional model and electronic device |
| CN113706683A (en)* | 2021-08-06 | 2021-11-26 | 网易(杭州)网络有限公司 | Shadow processing method and device of virtual three-dimensional model and electronic device |
| CN113919077A (en)* | 2021-10-29 | 2022-01-11 | 北京赛目科技有限公司 | Method and device for determining position information of vertex of patch and electronic equipment |
| CN113919077B (en)* | 2021-10-29 | 2025-10-10 | 北京赛目科技有限公司 | Method, device and electronic device for determining position information of facet vertices |
| CN114053696A (en)* | 2021-11-15 | 2022-02-18 | 完美世界(北京)软件科技发展有限公司 | Image rendering processing method and device and electronic equipment |
| CN114053696B (en)* | 2021-11-15 | 2023-01-10 | 完美世界(北京)软件科技发展有限公司 | Image rendering processing method, device and electronic equipment |
| CN114299200A (en)* | 2021-12-31 | 2022-04-08 | 网易(杭州)网络有限公司 | Cloth animation processing method and device, electronic device, storage medium |
| CN114299200B (en)* | 2021-12-31 | 2025-06-27 | 网易(杭州)网络有限公司 | Cloth animation processing method and device, electronic device, and storage medium |
| CN114401423A (en)* | 2022-01-13 | 2022-04-26 | 上海哔哩哔哩科技有限公司 | Data processing method and device |
| CN114401423B (en)* | 2022-01-13 | 2023-12-12 | 上海哔哩哔哩科技有限公司 | Data processing method and device |
| US12444015B2 (en) | 2023-01-13 | 2025-10-14 | Shanghai Bilibili Technology Co., Ltd. | Data processing method, computer device and storage medium |
| Publication number | Publication date |
|---|---|
| CN111773719B (en) | 2025-03-14 |
| Publication | Publication Date | Title |
|---|---|---|
| CN112652044B (en) | Particle special effect rendering method, device, equipment and storage medium | |
| CN111773719B (en) | Virtual object rendering method and device, storage medium, and electronic device | |
| US9934602B2 (en) | System, method and device for three-dimensional modeling | |
| KR102698917B1 (en) | Image processing method and device, electronic device and storage medium | |
| KR20080090671A (en) | Method and device for mapping texture to 3D object model | |
| CN114549723A (en) | Rendering method, device and device for lighting information in game scene | |
| CN111773688B (en) | Flexible object rendering method and device, storage medium and electronic device | |
| Ripolles et al. | Real-time tessellation of terrain on graphics hardware | |
| EP4394713A1 (en) | Image rendering method and apparatus, electronic device, computer-readable storage medium, and computer program product | |
| CN113076152B (en) | Rendering method and device, electronic equipment and computer readable storage medium | |
| CN116958390A (en) | Image rendering method, device, equipment, storage medium and program product | |
| CN108182721A (en) | Disturb fluid rendering intent and device | |
| JP4842242B2 (en) | Method and apparatus for real-time expression of skin wrinkles during character animation | |
| CN112132936A (en) | Picture rendering method and device, computer equipment and storage medium | |
| CN110930484B (en) | Animation configuration method and device, storage medium and electronic device | |
| CN119169175A (en) | Model rendering method, device, equipment and medium | |
| CN114445531B (en) | Method, device, storage medium and electronic device for realizing thundercloud effect | |
| CN114882153A (en) | Animation generation method and device | |
| CN114299203A (en) | Method and device for processing virtual model | |
| CN115761088B (en) | Element generation method, rendering method, device, electronic device, storage medium | |
| Yli-Pentti | On production of 3D character models for games | |
| Zhang | The Designation and Implementation for Human Skinned Mesh Animation Based on XNA | |
| CN118229852A (en) | Head start efficiency processing method and device, electronic equipment and storage medium | |
| CN118071895A (en) | Animation generation method, device, nonvolatile storage medium and computer equipment | |
| HK40022592A (en) | Method and device for configuring animation, storage medium and electronic device |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |