[go: up one dir, main page]

CN115797528A - Special effect processing method and device for virtual object and computer equipment - Google Patents

Special effect processing method and device for virtual object and computer equipment Download PDF

Info

Publication number
CN115797528A
CN115797528A CN202211390772.1A CN202211390772A CN115797528A CN 115797528 A CN115797528 A CN 115797528A CN 202211390772 A CN202211390772 A CN 202211390772A CN 115797528 A CN115797528 A CN 115797528A
Authority
CN
China
Prior art keywords
ablation
special effect
vertex
virtual object
edge
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211390772.1A
Other languages
Chinese (zh)
Other versions
CN115797528B (en
Inventor
刘方方
贝晓狮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Shi Guan Jin Yang Technology Development Co ltd
Original Assignee
Beijing Shi Guan Jin Yang Technology Development Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Shi Guan Jin Yang Technology Development Co ltd filed Critical Beijing Shi Guan Jin Yang Technology Development Co ltd
Priority to CN202211390772.1A priority Critical patent/CN115797528B/en
Publication of CN115797528A publication Critical patent/CN115797528A/en
Application granted granted Critical
Publication of CN115797528B publication Critical patent/CN115797528B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Generation (AREA)

Abstract

The application provides a special effect processing method, a special effect processing device and computer equipment for a virtual object, wherein after an ablation special effect processing request including at least one dissolving direction of a virtual object model is obtained, a first coordinate value on a coordinate axis of each vertex pixel of the virtual object model consistent with the dissolving direction can be obtained, an ablation dynamic threshold value corresponding to each ablation moment is compared with the first coordinate value of the vertex pixel to determine an ablation edge value of the vertex pixel, then the ablation edge value, a first dynamic control parameter and edge noise of the virtual object model are processed to obtain a first special effect processing parameter corresponding to the dissolving direction, and therefore a chip shader is used for carrying out special effect rendering on the first special effect processing parameter, a preset ablation threshold value, a special effect background graph and vertex data output by the vertex shader, so that the virtual object can show ablation special effects in the dissolving direction, and ablation special effect display effects of different virtual objects are enriched.

Description

虚拟对象的特效处理方法、装置及计算机设备Special effect processing method, device and computer equipment for virtual object

技术领域technical field

本申请涉及图像处理应用领域,具体涉及一种虚拟对象的特效处理方法、装置及计算机设备。The present application relates to the field of image processing applications, in particular to a special effect processing method, device and computer equipment for virtual objects.

背景技术Background technique

如游戏等动画应用中,通常是使用Unity引擎中的Shader图形化编程工具,对应用场景中的虚拟对象进行渲染处理,以实现虚拟对象随着应用操作而产生的游戏角色死亡、地图烧毁等场景下的消融效果,如游戏怪物死亡后从某一位置开始消失,直至蔓延到全身,达到类似于燃烧现象的消融效果等,从而满足游戏操作效果显示要求,提高玩家玩游戏的沉浸感和乐趣。In animation applications such as games, the Shader graphical programming tool in the Unity engine is usually used to render the virtual objects in the application scene, so as to realize the death of the game character and the burning of the map when the virtual object is operated with the application. For example, after the game monster dies, it disappears from a certain position until it spreads to the whole body, achieving the ablation effect similar to the burning phenomenon, etc., so as to meet the display requirements of the game operation effect and improve the immersion and fun of the player playing the game.

目前,为了实现虚拟对象的消融效果,Unity Shader是通过控制虚拟对象的三维模型特定边缘开始,控制其透明度从深变浅直至为零,来达到虚拟对象消失的效果,但这种特效处理方法所达到的消融效果并不理想,影响了游戏玩家体验。At present, in order to achieve the ablation effect of virtual objects, Unity Shader starts by controlling the specific edge of the 3D model of the virtual object, and controls its transparency from deep to light to zero to achieve the effect of virtual objects disappearing, but this special effect processing method is limited. The ablation effect achieved is not ideal, which affects the game player experience.

发明内容Contents of the invention

为了解决上述技术问题,本申请实施例提供如下技术方案:In order to solve the above technical problems, the embodiments of the present application provide the following technical solutions:

一方面,本申请提出了一种虚拟对象的特效处理方法,所述方法包括:On the one hand, the present application proposes a method for processing special effects of a virtual object, the method comprising:

获得针对虚拟对象模型的消融特效处理请求;所述消融特效处理请求包含对所述虚拟对象模型的至少一个溶解方向;Obtain an ablation special effect processing request for the virtual object model; the ablation special effect processing request includes at least one dissolution direction for the virtual object model;

响应所述消融特效处理请求,获得所述虚拟对象模型的各顶点像素的第一坐标值;所述第一坐标值是指与所述溶解方向一致的坐标轴上的坐标值;In response to the ablation special effect processing request, obtain a first coordinate value of each vertex pixel of the virtual object model; the first coordinate value refers to a coordinate value on a coordinate axis consistent with the dissolution direction;

依据所述第一坐标值与对应坐标轴上的消融动态阈值之间的比较结果,获得对应顶点像素的消融边缘值;所述消融边缘值的大小能够表征所述对象贴图上对应像素点的消融程度,所述消融动态阈值能够随消融时间的增加而改变;According to the comparison result between the first coordinate value and the ablation dynamic threshold on the corresponding coordinate axis, the ablation edge value of the corresponding vertex pixel is obtained; the size of the ablation edge value can represent the ablation of the corresponding pixel on the object map degree, the ablation dynamic threshold can change with the increase of ablation time;

对所述消融边缘值、第一动态控制参数以及针对所述虚拟对象模型的边缘噪声进行处理,得到对应所述溶解方向上的第一特效处理参数;所述第一动态控制参数用于控制对应顶点像素在所述溶解方向上的消融程度;Processing the ablation edge value, the first dynamic control parameter and the edge noise of the virtual object model to obtain the first special effect processing parameter corresponding to the dissolution direction; the first dynamic control parameter is used to control the corresponding The degree of ablation of vertex pixels in the direction of dissolution;

通过片元着色器对所述第一特效处理参数、预设消融阈值、特效背景图以及顶点着色器输出的顶点数据进行特效渲染,以使得所述虚拟对象在所述溶解方向上展示消融特效;所述特效背景图是通过对所述虚拟对象模型的对象贴图处理得到。performing special effect rendering on the first special effect processing parameters, the preset ablation threshold, the special effect background image, and the vertex data output by the vertex shader through the fragment shader, so that the virtual object displays an ablation special effect in the dissolution direction; The special effect background image is obtained through object mapping processing on the virtual object model.

可选的,所述依据所述第一坐标值与对应坐标轴上的消融动态阈值之间的比较结果,获得对应顶点像素的消融边缘值,包括:Optionally, the obtaining the ablation edge value of the corresponding vertex pixel according to the comparison result between the first coordinate value and the ablation dynamic threshold on the corresponding coordinate axis includes:

从所述溶解方向的第一个顶点像素开始,将各顶点像素的所述第一坐标值与消融动态阈值进行比较,得到当前消融时刻对应顶点像素的消融边缘值;Starting from the first vertex pixel in the dissolving direction, comparing the first coordinate value of each vertex pixel with the ablation dynamic threshold to obtain the ablation edge value of the corresponding vertex pixel at the current ablation moment;

按照预设规则,获得下一消融时刻对应的消融动态阈值;According to the preset rules, the ablation dynamic threshold corresponding to the next ablation moment is obtained;

将所述各顶点像素的所述第一坐标值与所述下一消融时刻对应的消融动态阈值进行比较,得到下一消融时刻对应顶点像素的消融边缘值,直至完成所述溶解方向上的最后一个顶点像素的消融。Comparing the first coordinate value of each vertex pixel with the ablation dynamic threshold corresponding to the next ablation moment, obtaining the ablation edge value of the corresponding vertex pixel at the next ablation moment, until the final Ablation of a vertex pixel.

可选的,所述按照预设规则,获得下一消融时刻对应的消融动态阈值,包括:Optionally, the obtaining the ablation dynamic threshold corresponding to the next ablation moment according to preset rules includes:

获取所述虚拟对象模型的对象贴图在所述溶解方向上各顶点像素的第一最大坐标值和第一最小坐标值;Acquiring the first maximum coordinate value and the first minimum coordinate value of each vertex pixel of the object map of the virtual object model in the dissolution direction;

通过插值方式,从所述第一最大坐标值到所述第一最小坐标值的范围内,顺次获得对应消融时刻的消融动态阈值。Through interpolation, within the range from the first maximum coordinate value to the first minimum coordinate value, ablation dynamic thresholds corresponding to ablation moments are sequentially obtained.

可选的,所述对所述消融边缘值、第一动态控制参数以及针对所述虚拟对象模型的边缘噪声进行处理,得到对应所述溶解方向上的第一特效处理参数,包括:Optionally, the processing the ablation edge value, the first dynamic control parameter, and the edge noise of the virtual object model to obtain the first special effect processing parameter corresponding to the dissolution direction includes:

获得针对所述虚拟对象模型的在所述溶解方向上的第一动态控制参数;obtaining a first dynamic control parameter in the dissolving direction for the virtual object model;

获取随机噪声,对所述随机噪声进行像素色度偏移处理,得到针对虚拟对象模型的对象贴图的边缘噪声;Obtain random noise, perform pixel chroma offset processing on the random noise, and obtain edge noise for the object map of the virtual object model;

对所述第一动态控制参数和所述边缘噪声进行相加,得到边缘控制参数;adding the first dynamic control parameter and the edge noise to obtain an edge control parameter;

依据阶跃函数,对所述边缘控制参数与所述消融边缘值进行处理,对处理结果进行反向处理,得到对应所述溶解方向上的第一特效处理参数。The edge control parameter and the ablation edge value are processed according to a step function, and the processing result is reversely processed to obtain a first special effect processing parameter corresponding to the dissolution direction.

可选的,所述顶点着色器输出的顶点数据的获取过程包括:Optionally, the acquisition process of the vertex data output by the vertex shader includes:

获得针对所述虚拟对象模型的各顶点像素的顶点坐标的扰动噪声;Obtaining perturbation noise for vertex coordinates of each vertex pixel of the virtual object model;

利用所述扰动噪声对所述顶点坐标的坐标值进行扰动处理,得到干扰顶点坐标;Using the disturbance noise to perform disturbance processing on the coordinate values of the vertex coordinates to obtain the disturbance vertex coordinates;

依据消融控制参数,在原有的所述顶点坐标和所述干扰顶点坐标之间进行线性插值,得到目标顶点坐标;所述消融控制参数至少依据所述第一动态控制参数获得;Performing linear interpolation between the original vertex coordinates and the interference vertex coordinates according to the ablation control parameters to obtain target vertex coordinates; the ablation control parameters are at least obtained according to the first dynamic control parameters;

通过顶点着色器对所述目标顶点坐标进行处理,得到能够表征目标空间下的目标显示位置的顶点数据。The vertex coordinates of the target are processed by the vertex shader to obtain vertex data that can represent the display position of the target in the target space.

可选的,所述至少依据所述第一动态控制参数,获得消融控制参数,包括:Optionally, the obtaining the ablation control parameter at least according to the first dynamic control parameter includes:

对所述第一动态控制参数和预设边缘颜色渐变梯度控制参数进行融合处理,得到边缘控制参数;performing fusion processing on the first dynamic control parameter and the preset edge color gradient control parameter to obtain the edge control parameter;

对所述边缘控制参数、所述第一动态控制参数以及所述第一坐标值进行平滑阶跃运算,得到在所述溶解方向上的消融控制参数。A smooth step operation is performed on the edge control parameter, the first dynamic control parameter, and the first coordinate value to obtain an ablation control parameter in the dissolution direction.

又一方面,本申请还提出了一种虚拟对象的特效处理装置,所述装置包括:In yet another aspect, the present application also proposes a virtual object special effect processing device, the device comprising:

消融特效处理请求获得模块,用于获得针对虚拟对象模型的消融特效处理请求;所述消融特效处理请求包含对所述虚拟对象模型的至少一个溶解方向;An ablation special effect processing request obtaining module, configured to obtain an ablation special effect processing request for a virtual object model; the ablation special effect processing request includes at least one dissolution direction for the virtual object model;

第一坐标值获得模块,用于响应所述消融特效处理请求,获得所述虚拟对象模型的各顶点像素的第一坐标值;所述第一坐标值是指与所述溶解方向一致的坐标轴上的坐标值;The first coordinate value obtaining module is configured to respond to the ablation special effect processing request and obtain the first coordinate value of each vertex pixel of the virtual object model; the first coordinate value refers to a coordinate axis consistent with the dissolution direction coordinate value on

消融边缘值获得模块,用于依据所述第一坐标值与对应坐标轴上的消融动态阈值之间的比较结果,获得对应顶点像素的消融边缘值;所述消融边缘值的大小能够表征所述对象贴图上对应像素点的消融程度,所述消融动态阈值能够随消融时间的增加而改变;The ablation edge value obtaining module is used to obtain the ablation edge value of the corresponding vertex pixel according to the comparison result between the first coordinate value and the ablation dynamic threshold on the corresponding coordinate axis; the size of the ablation edge value can represent the The ablation degree of the corresponding pixel on the object map, the ablation dynamic threshold can change with the increase of ablation time;

第一特效处理参数得到模块,用于对所述消融边缘值、第一动态控制参数以及针对所述虚拟对象模型的边缘噪声进行处理,得到对应所述溶解方向上的第一特效处理参数;所述第一动态控制参数用于控制对应顶点像素在所述溶解方向上的消融程度;The first special effect processing parameter obtaining module is used to process the ablation edge value, the first dynamic control parameter and the edge noise for the virtual object model to obtain the first special effect processing parameter corresponding to the dissolution direction; The first dynamic control parameter is used to control the degree of ablation of the corresponding vertex pixel in the dissolution direction;

特效渲染模块,用于通过片元着色器对所述第一特效处理参数、预设消融阈值、特效背景图以及顶点着色器输出的顶点数据进行特效渲染,以使得所述虚拟对象在所述溶解方向上展示消融特效;所述特效背景图是通过对所述虚拟对象模型的对象贴图处理得到。The special effect rendering module is used to perform special effect rendering on the first special effect processing parameters, the preset ablation threshold, the special effect background image and the vertex data output by the vertex shader through the fragment shader, so that the virtual object dissolves in the The ablation effect is displayed in the direction; the background image of the special effect is obtained by processing the object texture of the virtual object model.

可选的,所述消融边缘值获得模块包括:Optionally, the ablation edge value obtaining module includes:

第一比较单元,用于从所述溶解方向的第一个顶点像素开始,将各顶点像素的所述第一坐标值与消融动态阈值进行比较,得到当前消融时刻对应顶点像素的消融边缘值;The first comparison unit is configured to compare the first coordinate value of each vertex pixel with the ablation dynamic threshold starting from the first vertex pixel in the dissolving direction, to obtain the ablation edge value of the corresponding vertex pixel at the current ablation moment;

消融动态阈值获得单元,用于按照预设规则,获得下一消融时刻对应的消融动态阈值;The ablation dynamic threshold obtaining unit is configured to obtain the ablation dynamic threshold corresponding to the next ablation moment according to preset rules;

第二比较单元,用于将所述各顶点像素的所述第一坐标值与所述下一消融时刻对应的消融动态阈值进行比较,得到下一消融时刻对应顶点像素的消融边缘值,直至完成所述溶解方向上的最后一个顶点像素的消融。The second comparison unit is configured to compare the first coordinate value of each vertex pixel with the ablation dynamic threshold corresponding to the next ablation moment, to obtain the ablation edge value of the corresponding vertex pixel at the next ablation moment, until the completion The ablation of the last vertex pixel in the dissolve direction.

可选的,所述消融动态阈值获得单元,包括:Optionally, the ablation dynamic threshold obtaining unit includes:

坐标值获取单元,用于获取所述虚拟对象模型的对象贴图在所述溶解方向上各顶点像素的第一最大坐标值和第一最小坐标值;A coordinate value acquisition unit, configured to acquire the first maximum coordinate value and the first minimum coordinate value of each vertex pixel in the dissolution direction of the object map of the virtual object model;

插值获得单元,用于通过插值方式,从所述第一最大坐标值到所述第一最小坐标值的范围内,顺次获得对应消融时刻的消融动态阈值。The interpolation obtaining unit is configured to sequentially obtain the ablation dynamic threshold corresponding to the ablation moment within the range from the first maximum coordinate value to the first minimum coordinate value by interpolation.

又一方面,本申请还提出了一种计算机设备,所述计算机设备包括:In yet another aspect, the present application also proposes a computer device, the computer device comprising:

通信模块;communication module;

存储器,用于存储如上述的虚拟对象的特效处理方法的程序;The memory is used to store the program of the above-mentioned special effect processing method for the virtual object;

处理器,用于加载并执行所述存储器存储的所述程序,实现如上述的虚拟对象的特效处理方法的各步骤。The processor is configured to load and execute the program stored in the memory, so as to implement the steps of the above-mentioned special effect processing method for a virtual object.

又一方面,本申请还提出了一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器加载执行,实现如上述的虚拟对象的特效处理方法。In yet another aspect, the present application also proposes a computer-readable storage medium on which a computer program is stored, wherein the computer program is loaded and executed by a processor to implement the above-mentioned special effect processing method for a virtual object.

由此可见,基于上述技术方案,本申请获得包含对虚拟对象模型的至少一个溶解方向的消融特效处理请求后,可以获得虚拟对象模型的各顶点像素的与该溶解方向一致的坐标轴上的第一坐标值,将各消融时刻对应的消融动态阈值与顶点像素的第一坐标值进行比较,确定该顶点像素的消融边缘值,之后,对消融边缘值、第一动态控制参数以及针对虚拟对象模型的边缘噪声进行处理,得到对应溶解方向上的第一特效处理参数,从而通过片元着色器对第一特效处理参数、预设消融阈值、特效背景图以及顶点着色器输出的顶点数据进行特效渲染,以使得虚拟对象在溶解方向上展示消融特效,丰富不同虚拟对象的消融特效展示效果。It can be seen that based on the above technical solution, after the application obtains an ablation special effect processing request including at least one dissolution direction of the virtual object model, the first coordinate axis of each vertex pixel of the virtual object model on the coordinate axis consistent with the dissolution direction can be obtained. A coordinate value, compare the ablation dynamic threshold value corresponding to each ablation moment with the first coordinate value of the vertex pixel, determine the ablation edge value of the vertex pixel, and then, the ablation edge value, the first dynamic control parameter and the virtual object model The edge noise is processed to obtain the first special effect processing parameters corresponding to the dissolution direction, so that the first special effect processing parameters, the preset ablation threshold, the special effect background image and the vertex data output by the vertex shader are rendered by the fragment shader. , so that the virtual object displays the ablation special effect in the dissolving direction, and enriches the display effect of the ablation special effect of different virtual objects.

附图说明Description of drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present application, and those skilled in the art can also obtain other drawings according to the provided drawings without creative work.

图1为适用于本申请提出的虚拟对象的特效处理方法的计算机设备一可选示例的硬件结构示意图;FIG. 1 is a schematic diagram of the hardware structure of an optional example of computer equipment applicable to the special effect processing method for virtual objects proposed in this application;

图2为适用于本申请提出的虚拟对象的特效处理方法的计算机设备又一可选示例的硬件结构示意图;Fig. 2 is a schematic diagram of the hardware structure of another optional example of computer equipment applicable to the special effect processing method for virtual objects proposed in this application;

图3为本申请提出的虚拟对象的特效处理方法的一可选示例的流程示意图;FIG. 3 is a schematic flowchart of an optional example of the special effect processing method for virtual objects proposed in this application;

图4为适用于本申请提出的虚拟对象的特效处理方法中,Unity Shader Graph创建过程示意图;Fig. 4 is a schematic diagram of the creation process of Unity Shader Graph in the special effect processing method applicable to the virtual object proposed in this application;

图5为适用于本申请提出的虚拟对象的特效处理方法中,各像素的消融边缘值的动态获取过程示意图;Fig. 5 is a schematic diagram of the dynamic acquisition process of the ablation edge value of each pixel in the special effect processing method applicable to the virtual object proposed in this application;

图6为适用于本申请提出的虚拟对象的特效处理方法中,动态控制参数获取过程示意图;FIG. 6 is a schematic diagram of the dynamic control parameter acquisition process applicable to the special effect processing method for virtual objects proposed in this application;

图7为适用于本申请提出的虚拟对象的特效处理方法中,边缘噪声的获取方法示意图;FIG. 7 is a schematic diagram of a method for obtaining edge noise in the special effect processing method applicable to virtual objects proposed in this application;

图8为适用于本申请提出的虚拟对象的特效处理方法中,特效处理参数的获取方法示意图;FIG. 8 is a schematic diagram of a method for obtaining special effect processing parameters in the special effect processing method applicable to virtual objects proposed in this application;

图9为适用于本申请提出的虚拟对象的特效处理方法中,边缘渐变色的获取方法示意图;FIG. 9 is a schematic diagram of a method for obtaining edge gradient colors in the special effect processing method applicable to virtual objects proposed in this application;

图10为适用于本申请提出的虚拟对象的特效处理方法中,特效背景图和特效渲染过程示意图;10 is a schematic diagram of a special effect background image and a special effect rendering process applicable to the special effect processing method for virtual objects proposed in this application;

图11为本申请提出的虚拟对象的特效处理方法的又一可选示例的流程示意图;Fig. 11 is a schematic flowchart of another optional example of the method for processing special effects of virtual objects proposed in this application;

图12为本申请提出的虚拟对象的特效处理方法的又一可选示例的流程示意图;Fig. 12 is a schematic flowchart of another optional example of the method for processing special effects of virtual objects proposed in this application;

图13为适用于本申请提出的虚拟对象的特效处理方法中,顶点扰动过程示意图;13 is a schematic diagram of the vertex perturbation process in the special effect processing method applicable to the virtual object proposed in this application;

图14为适用于本申请提出的虚拟对象的特效处理方法中,顶点数据获取方法示意图;Fig. 14 is a schematic diagram of a vertex data acquisition method applicable to the special effect processing method of a virtual object proposed in this application;

图15为本申请提出的虚拟对象的特效处理装置的一可选示例的结构示意图。FIG. 15 is a schematic structural diagram of an optional example of a virtual object special effect processing device proposed in the present application.

具体实施方式Detailed ways

针对背景技术部分的描述内容,在游戏角色死亡、地图烧毁等场景渲染处理中,希望对应虚拟对象的三维模型经过腐蚀消融消失的效果,同时让粒子以模型的样子出现并消散,变成灰烬粒子消散的效果,可以使得虚拟对象从完整状态的任一端边缘开始,以溶解的形式慢慢变没有;而在召唤游戏角色出现、场景环境变化等过程中,可以以期望虚拟对象的任一端边缘开始,由粒子形式从零开始慢慢出现实体直到整个模型显示出来。In view of the description in the background technology section, in the scene rendering processing such as the death of game characters and the burning of maps, it is hoped that the 3D model corresponding to the virtual object will disappear after corrosion and ablation, and at the same time let the particles appear and dissipate in the form of the model, turning into ash particles The effect of dissipation can make the virtual object start from the edge of either end of the complete state and gradually disappear in the form of dissolution; while in the process of summoning the appearance of the game character and changing the scene environment, it can start from the edge of either end of the expected virtual object , starting from zero in the form of particles and slowly appearing entities until the entire model is displayed.

其中,在消融显示和隐藏的过程中,由于Unity Shader采用透明度控制方式所达到的效果无法提现消融的过程,影响虚拟对象特效展示效果。因此,本申请提出以粒子形式从任一端边缘开始体现出消融效果,对此,本申请提出使用Alpha Clip对虚拟对象的三维模型进行裁切,对切口处做一层随机噪声来控制Alpha Clip,使用随机噪声对消融区域从任一端开始的边缘进行扰动,从而混合一个颜色,即消融区域与不消融区域之间的过渡色,使得消融的虚拟对象模型碎片作为灰烬飘散,即以粒子的形式从任一边缘开始体现消融效果,且在消融过程中,粒子的颜色还可以叠加渐变色,更好地满足不同特效展示效果,丰富特效展示方式,提高玩家沉浸感。Among them, in the process of ablation display and hiding, the effect achieved by the transparency control method of Unity Shader cannot be reflected in the ablation process, which affects the special effect display effect of virtual objects. Therefore, this application proposes to display the ablation effect from the edge of any end in the form of particles. In this regard, this application proposes to use Alpha Clip to cut the 3D model of the virtual object, and make a layer of random noise on the incision to control Alpha Clip. Random noise is used to perturb the edge of the ablation area from either end to mix a color, that is, the transition color between the ablation area and the non-ablation area, so that the ablation virtual object model fragments are scattered as ash, that is, in the form of particles from Any edge starts to reflect the ablation effect, and during the ablation process, the color of the particles can also be superimposed with a gradient color to better meet the display effects of different special effects, enrich the display methods of special effects, and improve the player's sense of immersion.

在上述虚拟对象渲染过程中,对于不同虚拟对象的模型构建以及特效实现过程,可以依据但并不局限于人工智能(Artificial Intelligence,AI)包含的图形处理技术、机器学习(Machine Learning,ML)/深度学习技术、计算机视觉技术(Computer Vision,CV)中的图像识别与处理、三维物体重建、三维技术等实现,本申请对虚拟对象的三维模型构建及渲染实现过程不做详述,可以依据应用需求,结合适合的人工智能技术提高渲染效率及可靠性。In the above-mentioned virtual object rendering process, the model construction and special effect realization process of different virtual objects can be based on but not limited to the graphics processing technology included in artificial intelligence (AI), machine learning (Machine Learning, ML)/ In-depth learning technology, computer vision technology (Computer Vision, CV) image recognition and processing, 3D object reconstruction, 3D technology, etc., this application does not elaborate on the implementation process of 3D model construction and rendering of virtual objects, which can be based on the application Combined with appropriate artificial intelligence technology to improve rendering efficiency and reliability.

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the application with reference to the drawings in the embodiments of the application. Apparently, the described embodiments are only some of the embodiments of the application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.

参照图1,为适用于本申请提出的虚拟对象的特效处理方法的计算机设备一可选示例的硬件结构示意图,结合上述分析,该计算机设备可以是服务器和/或电子设备,该服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或分布式系统,还可以是支持云计算服务的云服务器等。服务器可以通过有线或无线通信方式,实现与如智能手机、平板电脑、笔记本电脑、台式计算机、上网本等电子设备直接或间接地连接,满足电子设备与服务器之间的数据交互需求,具体通信连接方式可视情况而定。Referring to Fig. 1, it is a schematic diagram of the hardware structure of an optional example of computer equipment suitable for the special effect processing method of virtual objects proposed in this application. In combination with the above analysis, the computer equipment can be a server and/or electronic equipment, and the server can be an independent The physical server can also be a server cluster or distributed system composed of multiple physical servers, or a cloud server that supports cloud computing services. The server can be directly or indirectly connected to electronic devices such as smartphones, tablet computers, laptops, desktop computers, and netbooks through wired or wireless communication methods to meet the data interaction needs between electronic devices and servers. The specific communication connection method Subject to availability.

如图1所示,本申请实施例提出的计算机设备可以包括但并不局限于:通信模块11、存储器12和处理器13,其中:As shown in FIG. 1, the computer device proposed in the embodiment of the present application may include but not limited to: a communication module 11, a memory 12 and a processor 13, wherein:

通信模块11、存储器12和处理器13各自的数量可以为至少一个,且通信模块11、存储器12和处理器13可以均连接通信总线,以实现相互间的数据通信,具体通信过程可视情况而定。The respective quantity of communication module 11, memory 12 and processor 13 can be at least one, and communication module 11, memory 12 and processor 13 can all be connected to communication bus, to realize the data communication between each other, the specific communication process may vary depending on the situation Certainly.

通信模块11可以包括GSM模块、GPRS模块、WIFI模块,和/或实现其他无线通信网络或有线通信网络的通信模块等,还可以包括如USB接口、串/并口等通信模块,以实现计算机设备内部组成部件相互之间的数据传输,本申请对计算机设备所包含的通信模块的类型及其数量不做限制,可以依据应用场景下的数据通信需求确定,本实施例在此不做一一详述。Communication module 11 can comprise GSM module, GPRS module, WIFI module, and/or realize the communication module etc. of other wireless communication network or wired communication network, can also comprise such as communication module such as USB interface, serial/parallel port, to realize computer equipment interior For the data transmission between the components, this application does not limit the type and quantity of the communication modules included in the computer equipment, which can be determined according to the data communication requirements in the application scenario, and this embodiment will not describe them in detail here. .

存储器12可以用于存储实现本申请提出的虚拟对象的特效处理方法的程序,处理器13可以用于加载并执行存储器12所存储的程序,以实现本申请实施例提出的虚拟对象的特效处理方法的各步骤,具体实现过程可以参照但并不局限于下文方法实施例相应部分的描述,在此不做详述。The memory 12 can be used to store a program implementing the special effect processing method for virtual objects proposed in this application, and the processor 13 can be used to load and execute the program stored in the memory 12 to realize the special effect processing method for virtual objects proposed in the embodiment of this application For each step, the specific implementation process can refer to but is not limited to the description of the corresponding part of the method embodiment below, and will not be described in detail here.

在本申请实施例中,存储器12可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件或其他易失性固态存储器件。处理器13,可以为中央处理器(Central Processing Unit,CPU)、特定应用集成电路(application-specificintegrated circuit,ASIC)、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件等。In the embodiment of the present application, the memory 12 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device or other volatile solid-state storage devices. The processor 13 can be a central processing unit (Central Processing Unit, CPU), an application-specific integrated circuit (application-specific integrated circuit, ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a ready-made programmable gate array (FPGA) or other programmable logic devices, etc.

应该理解的是,图1所示的计算机设备的结构并不构成对本申请实施例中计算机设备的限定,在实际应用中,计算机设备可以包括比图1所示的更多或更少的部件,或者组合某些部件。示例性的,若上述计算机设备为如上文列举的电子设备,该电子设备可以配置有支持应用正常运行的应用引擎,如游戏引擎,此外,从硬件结构来看,参照图2所示,该电子设备还可以包括如显示器、各输入设备、各输出设备、天线、电源模块、传感器模块等,本申请在此不做一一列举。It should be understood that the structure of the computer device shown in FIG. 1 does not constitute a limitation to the computer device in the embodiment of the present application. In practical applications, the computer device may include more or fewer components than those shown in FIG. 1 , Or combine certain parts. Exemplarily, if the above-mentioned computer device is an electronic device as listed above, the electronic device may be configured with an application engine that supports the normal operation of the application, such as a game engine. In addition, from the perspective of hardware structure, as shown in FIG. 2, the electronic The device may also include, for example, a display, various input devices, various output devices, antennas, power supply modules, sensor modules, etc., which are not listed here in this application.

下面将从计算机设备角度,来详细描述本申请提出的虚拟对象的特效处理方法,但并不局限于下文各实施例描述的实现方法,且对于本申请中使用流程图所说明的根据本申请实施例的计算机设备所执行的操作,可以理解,前面或后面操作不一定按照顺序来精确地执行。相反,可以按照倒序或同时处理各个步骤。同时,也可以将其他操作添加到这些过程中,或从这些过程移除某一步或数步操作,本申请下文实施例并未一一详述,但均属于本申请技术方案的保护范围。From the perspective of computer equipment, the special effect processing method of virtual objects proposed in this application will be described in detail below, but it is not limited to the implementation methods described in the following embodiments. Operations performed by the computer device of the example, it can be understood that the previous or subsequent operations are not necessarily performed in exact order. Instead, various steps may be processed in reverse order or simultaneously. At the same time, other operations can also be added to these processes, or one or several steps of operations can be removed from these processes. The following embodiments of the application are not described in detail, but all belong to the protection scope of the technical solutions of the application.

参照图3,为本申请提出的虚拟对象的特效处理方法的一可选示例的流程示意图,该方法适用于如上文描述的计算机设备,如图3所示,该方法可以包括但并不局限于以下步骤:Referring to FIG. 3 , it is a schematic flowchart of an optional example of the method for processing special effects of virtual objects proposed in this application. This method is applicable to the computer device as described above. As shown in FIG. 3 , this method may include but is not limited to The following steps:

步骤S31,获得针对虚拟对象模型的消融特效处理请求;该消融特效处理请求包含对虚拟对象模型的至少一个溶解方向;Step S31, obtaining an ablation special effect processing request for the virtual object model; the ablation special effect processing request includes at least one dissolution direction for the virtual object model;

在本申请实际应用中,可以使用Unity引擎中的Shader图形化编程工具(即ShaderGraph)实现虚拟对象模型数据的处理,这样,在需要对某虚拟对象模型进行消融特效处理时,由于不需要考虑光照效果,可以创建Unity Shader Graph,如图4所示的Unity ShaderGraph创建过程示意图,在启动Shader Graph编辑器后,可以对输出的编辑界面中的Project(项目)窗口右击,输出该项目下级菜单,之后,可以按照Create/Shader/UniversalRender Pipeline/Unlit Shader Graph这一路径,对相应菜单面板中的对象进行触发,以创建Unlit Shader Graph,但并不局限于图4所示的创建实现方式。In the actual application of this application, the Shader graphical programming tool (i.e. ShaderGraph) in the Unity engine can be used to realize the processing of the virtual object model data. Effect, you can create a Unity Shader Graph, as shown in Figure 4, the schematic diagram of the creation process of the Unity ShaderGraph. After starting the Shader Graph editor, you can right-click the Project (project) window in the output editing interface to output the submenu of the project. After that, you can follow the path of Create/Shader/UniversalRender Pipeline/Unlit Shader Graph to trigger the objects in the corresponding menu panel to create Unlit Shader Graph, but it is not limited to the creation method shown in Figure 4.

之后,本申请实施例可以双击所创建的Unlit Shader Graph文件,打开ShaderGraph编辑器,之后,可以使用Shader Graph编辑器所具有的编程功能,完成本申请提出的虚拟对象的特效处理方法,得到具有处理得到的消融特效的虚拟对象模型数据,存储于所创建的Unlit Shader Graph文件,这样,在玩家对该虚拟对象执行对应操作,可以执行该Unlit Shader Graph文件,控制该虚拟对象呈现预设的消融特效。Afterwards, the embodiment of the present application can double-click the created Unlit Shader Graph file to open the ShaderGraph editor. Afterwards, the programming function that the Shader Graph editor has can be used to complete the special effect processing method of the virtual object proposed by the application, and obtain The virtual object model data of the obtained ablation effect is stored in the created Unlit Shader Graph file, so that when the player performs corresponding operations on the virtual object, the Unlit Shader Graph file can be executed to control the virtual object to present the preset ablation effect .

基于上述分析,在Shader Graph编辑器的编辑界面,可以选择本次需要特效处理的虚拟对象模型,及其需要展示的特效类型(本申请以粒子形式逐渐溶解的消融特效这一特效类型为例进行说明)、虚拟对象展示该消融特效过程的溶解方向等模型数据,点击确认按钮,获得针对所选择的虚拟对象模型的消融特效处理请求,本申请对该消融特效处理请求包含的内容及其获得方法不做限制,可视情况而定。Based on the above analysis, in the editing interface of the Shader Graph editor, you can select the virtual object model that needs special effects processing this time, and the type of special effects that need to be displayed (this application takes the special effect type of ablation special effects that gradually dissolve in the form of particles as an example) Description), the virtual object displays the model data such as the dissolution direction of the ablation special effect process, click the confirmation button, and obtain the ablation special effect processing request for the selected virtual object model, the content contained in the ablation special effect processing request in this application and its obtaining method There is no limit, depending on the situation.

其中,上述溶解方向可以包括但并不局限于:从上向下、、从下向上、从左往右、从右往左等之中的从任一方位到对应方位(即增加180°得到的直线方向)形成的直线方向,也可以是预设曲线或自定义曲线(其可以依据所选择的虚拟对象模型结构确定等)的曲线方向等,本申请对溶解方向所形成的消融路径及其获取方法不做限制,可视情况而定。Wherein, the above-mentioned dissolving directions may include but are not limited to: from any orientation to the corresponding orientation (that is, obtained by increasing 180°) from top to bottom, from bottom to top, from left to right, from right to left, etc. The straight line direction formed by the straight line direction) can also be the curve direction of a preset curve or a custom curve (which can be determined according to the selected virtual object model structure, etc.). The method is not limited, depending on the situation.

应该理解的是,上述溶解方向是指所选择的虚拟对象展示消融特效过程中,从虚拟对象的某一方位或多个方位的边缘开始,按照一定方向以粒子形式逐渐溶解,直至虚拟对象消失不见。可见,对于不同的虚拟对象模型所选择的溶解方向不同,从对应边缘开始以粒子形式逐渐消融的特效展示效果也会所有差异,可以该虚拟对象模型需要展示的消融特效,灵活选择一个或多个溶解方向,据此实现该虚拟对象模型的有方向性的溶解。可见,相对于对各虚拟对象都从固定的边缘开始消融的处理方式,本申请提出的具有方向性的消融处理方式,实现了不同虚拟对象的消融特效的个性化展示,提高了不同虚拟对象的消融特效展示效果。It should be understood that the above-mentioned dissolving direction means that during the process of displaying the ablation effect of the selected virtual object, starting from the edge of a certain orientation or multiple orientations of the virtual object, it gradually dissolves in the form of particles according to a certain direction until the virtual object disappears. . It can be seen that for different virtual object models, the selected dissolution direction is different, and the special effect display effect of gradual ablation in the form of particles from the corresponding edge will also be different. You can flexibly choose one or more special effects for the virtual object model to display. A dissolve direction, whereby a directional dissolve of the virtual object model is achieved. It can be seen that, compared with the processing method in which each virtual object is ablated from a fixed edge, the directional ablation processing method proposed in this application realizes the personalized display of the ablation effects of different virtual objects and improves the accuracy of different virtual objects. The ablation effect shows the effect.

步骤S32,响应该消融特效处理请求,获得虚拟对象模型的各顶点像素的第一坐标值;Step S32, in response to the ablation special effect processing request, obtain the first coordinate value of each vertex pixel of the virtual object model;

在实际应用中,虚拟对象模型通常包括一组三角面片,每个三角面片由三个顶点构成,每个顶点通常包括如顶点位置、法线/切线纹理坐标等顶点数据,以便后续可以对顶点数据进行处理,结合其他模型数据,渲染虚拟对象。In practical applications, a virtual object model usually includes a set of triangular patches, each of which is composed of three vertices, and each vertex usually includes vertex data such as vertex position, normal/tangent texture coordinates, etc. Vertex data is processed, combined with other model data, to render virtual objects.

因此,按照上文描述的方法,确定需要获得虚拟对象模型按照溶解方向的消融特效的场景下,对该虚拟对象模型进行裁切,确定切口处的顶点坐标,如图5所示,可以由Position(位置)节点对该虚拟对象模型进行处理,获得各顶点像素的顶点坐标,该顶点坐标通常是世界坐标系下的(x,y,z)三维坐标,根据需要还可以包括法线、颜色和纹理坐标,本申请对顶点坐标包含的坐标属性不做限制,可视情况而定。Therefore, according to the method described above, in the scene where it is determined that the ablation effect of the virtual object model according to the dissolution direction needs to be obtained, the virtual object model is cut to determine the vertex coordinates at the incision, as shown in Figure 5, which can be determined by Position The (position) node processes the virtual object model to obtain the vertex coordinates of each vertex pixel. The vertex coordinates are usually (x, y, z) three-dimensional coordinates in the world coordinate system, and can also include normal, color and Texture coordinates, this application does not limit the coordinate attributes included in the vertex coordinates, and it depends on the situation.

之后,针对所选择的虚拟对象模型的溶解方向,可以从各顶点坐标中,提取对应分量的第一坐标值,以溶解方向为从上向下为例进行说明,可以将获得的各顶点像素的顶点坐标输入Split(分离或分裂)节点,分离顶点坐标中的各分量,如R、G、B和A等分量,本实施例可以提取RGB中的G分量,即顶点坐标的y坐标;若所选择的溶解方向为从左向右消融,按照这种分量提取方式,可以提取R分量,即顶点坐标的x坐标等。可见,本申请预先选择的溶解方向不同,本申请可以提取各顶点像素的多维顶点坐标中,与该溶解方向一致坐标轴上的坐标值记为第一坐标值,用以实现后续处理。Afterwards, for the dissolving direction of the selected virtual object model, the first coordinate value of the corresponding component can be extracted from the coordinates of each vertex, and the dissolving direction is from top to bottom as an example for illustration, and the obtained pixel values of each vertex can be Vertex coordinate input Split (separate or split) node, separates each component in the vertex coordinate, as components such as R, G, B and A, present embodiment can extract the G component in the RGB, i.e. the y coordinate of the vertex coordinate; The selected dissolution direction is ablation from left to right. According to this component extraction method, the R component can be extracted, that is, the x coordinate of the vertex coordinates, etc. It can be seen that the dissolving directions pre-selected in this application are different, and this application can extract the coordinate value on the coordinate axis consistent with the dissolving direction among the multi-dimensional vertex coordinates of each vertex pixel, and record it as the first coordinate value for subsequent processing.

需要说明,关于Shader Graph编辑器中的Position节点以及Split节点各自对输入数据的处理实现过程,本申请不做详述。It should be noted that this application does not describe in detail the implementation process of the Position node and the Split node in the Shader Graph editor for processing the input data respectively.

步骤S33,依据该第一坐标值与对应坐标轴上的消融动态阈值之间的比较结果,获得对应像素的消融边缘值;Step S33, according to the comparison result between the first coordinate value and the ablation dynamic threshold on the corresponding coordinate axis, obtain the ablation edge value of the corresponding pixel;

本申请实施例中,顶点像素在不同坐标轴上即不同溶解方向上的消融动态阈值Start可以不同,初始值往往都比较大,且能够随着消融时间的增加而减少,本申请对不同溶解方向上在不同消融时间对应的消融动态阈值不做限制。In the embodiment of this application, the ablation dynamic threshold Start of vertex pixels on different coordinate axes, that is, in different dissolution directions, can be different. The initial value is often relatively large, and can decrease with the increase of ablation time. This application has different dissolution directions. There is no limitation on the ablation dynamic thresholds corresponding to different ablation times.

基于此,为了让虚拟对象模型的溶解具有方向性,仍以从上向下的溶解方向为例进行说明,其对应的消融动态阈值记为StartY,之后,如图5所示,可以将提取出的各顶点像素的第一坐标值与该消融动态阈值进行比较,若第一坐标值相比于消融动态阈值越大,对应顶点像素的消融边缘值越大,由于该消融边缘值(即Edge值)的大小能够表征顶点像素在消融过程中的消融程度,消融边缘值越大,说明对应顶点像素的消融程度越大。Based on this, in order to make the dissolution of the virtual object model directional, the dissolution direction from top to bottom is still taken as an example for illustration, and the corresponding dynamic threshold of ablation is recorded as StartY. Afterwards, as shown in Figure 5, the extracted The first coordinate value of each vertex pixel is compared with the ablation dynamic threshold value, if the first coordinate value is larger than the ablation dynamic threshold value, the ablation edge value of the corresponding vertex pixel is larger, because the ablation edge value (ie Edge value ) can represent the ablation degree of the vertex pixel in the ablation process, and the larger the ablation edge value, the greater the ablation degree of the corresponding vertex pixel.

其中,由于消融动态阈值的数值会随消融时间T的增加而减小,在展示消融特效之前,即T=0时,由于StartY往往比较大,虚拟对象模型中各顶点像素的第一坐标值通常都小于当前消融时刻的StartY,使得各顶点像素的消融边缘Edge值都为零,那么,该虚拟对象模型的对象贴图都没有溶解;随着消融时间T从0递增,StartY的取值可以按照预设规则递减(可以由减Subtract节点执行),对象贴图从上到下的各顶点像素中,第一坐标值大于对应消融时刻的StartY的顶点像素数量逐渐增多,与此同时,从上到下的顶点像素的消融边缘Edge值会逐渐增加(其相对于顶点像素自身上一消融时刻的消融边缘Edge值来说),最上方的顶点像素的消融边缘Edge值最大,其消融程度最大,由此实现了虚拟对象模型的对象贴图的从上向下的逐渐溶解,即实现了有方向性的溶解。Among them, since the value of the ablation dynamic threshold will decrease with the increase of the ablation time T, before the ablation effect is displayed, that is, when T=0, since StartY is often relatively large, the first coordinate value of each vertex pixel in the virtual object model is usually are smaller than StartY at the current ablation time, so that the ablation edge Edge value of each vertex pixel is zero, then the object texture of the virtual object model is not dissolved; as the ablation time T increases from 0, the value of StartY can be set according to the preset value. Assuming that the rule is decreasing (can be executed by the Subtract node), among the vertex pixels of the object map from top to bottom, the number of vertex pixels whose first coordinate value is greater than the StartY corresponding to the ablation moment increases gradually. At the same time, the number of vertex pixels from top to bottom The ablation edge Edge value of the vertex pixel will gradually increase (relative to the ablation edge Edge value of the vertex pixel itself at the last ablation moment), and the ablation edge Edge value of the top vertex pixel is the largest, and its ablation degree is the largest, thus realizing The object map of the virtual object model is gradually dissolved from top to bottom, that is, the directional dissolution is realized.

关于其他溶解方向上的顶点像素的消融边缘Edge值的获取过程,与上文描述的顶点像素从上向下的Edge值获取过程类似,本申请不做一一举例详述。需要说明,对于不同溶解方向的消融过程中,顶点像素的消融动态阈值的取值实现方法本申请不做限制。可选的,如图5所示,可以针对虚拟对象模型的对象贴图,确定各顶点像素对应坐标轴上的第一最大坐标值(如图5中Max(1)输入的坐标值)和第一最小坐标值(如图5中Min(1)输入的坐标值),之后,可以在消融过程中,从第一最大坐标值开始,递减取值得到对应消融时刻的StartY。The acquisition process of the edge value of the ablation edge of the vertex pixels in other dissolving directions is similar to the acquisition process of the edge value of the vertex pixel from top to bottom described above, and this application does not give examples for details. It should be noted that, in the ablation process of different dissolution directions, the implementation method of the ablation dynamic threshold value of the vertex pixels is not limited in this application. Optionally, as shown in FIG. 5, the first maximum coordinate value on the coordinate axis corresponding to each vertex pixel (the coordinate value input by Max(1) in FIG. 5) and the first The minimum coordinate value (such as the coordinate value input by Min(1) in Figure 5), after that, during the ablation process, starting from the first maximum coordinate value, the value can be decremented to obtain the StartY corresponding to the ablation moment.

步骤S34,对消融边缘值、第一动态控制参数以及针对虚拟对象模型的边缘噪声进行处理,得到对应溶解方向上的第一特效处理参数;Step S34, processing the ablation edge value, the first dynamic control parameter and the edge noise for the virtual object model to obtain the first special effect processing parameter corresponding to the direction of dissolution;

为了动态控制虚拟对象的消融程度,预览处理得到的消融特效,通常可以需要设置相应的动态控制参数,对于不同溶解方向上呈现的消融特效,所设置的动态控制参数的数值可以不同,其可以依据顶点像素对应坐标轴上的坐标值获得,本申请对动态控制参数的获取方法不做限制。本申请实施例仍以展示从上向下溶解方向的消融特效为例进行说明,将其对应配置的动态控制参数即为第一动态控制参数,对于其他溶解方向对应的动态控制参数可以即为第二动态控制参数或第三动态控制参数等,本申请对其获取过程不做一一举例详述。In order to dynamically control the ablation degree of the virtual object and preview the obtained ablation effects, it is usually necessary to set corresponding dynamic control parameters. For the ablation effects presented in different dissolution directions, the values of the set dynamic control parameters can be different, which can be based on The coordinate values on the coordinate axes corresponding to the vertex pixels are obtained, and this application does not limit the method for obtaining dynamic control parameters. In the embodiment of the present application, the ablation effect in the dissolving direction from top to bottom is still taken as an example for illustration, and the corresponding dynamic control parameter configured is the first dynamic control parameter, and the dynamic control parameters corresponding to other dissolving directions can be the second For the second dynamic control parameter or the third dynamic control parameter, etc., the present application does not give examples to describe the acquisition process one by one.

基于此,参照图6所示的动态控制参数获取过程示意图,可以创建一个溶解节点disolve,其为float节点,在0~1之间取值,0可以表示没有消融,1可以表示完全消融,可见,该disolve节点的取值(即消融参数)大小可以表征消融程度,可以将其转为对应顶点坐标的属性,控制类型可以选择滑块Slider,将其输出的溶解参数(如图6中Remap节点输出参数,输入Smoothstep节点的边缘Edge(1)端)与各顶点像素的第一坐标值(如顶点坐标的y分量)进行平滑阶跃(如图6所示的Smoothstep节点)处理,得到对应顶点像素的第一动态控制参数,具体计算过程本申请不做详述。Based on this, referring to the schematic diagram of the dynamic control parameter acquisition process shown in Figure 6, a dissolve node disolve can be created, which is a float node and takes a value between 0 and 1. 0 can indicate no ablation, and 1 can indicate complete ablation. It can be seen that , the value of the disolve node (that is, the ablation parameter) can represent the degree of ablation, and it can be converted into an attribute corresponding to the vertex coordinates. The control type can be selected as Slider, and the dissolution parameter output by it (as shown in the Remap node in Figure 6 Output parameter, input the edge Edge (1) end of the Smoothstep node) and the first coordinate value of each vertex pixel (such as the y component of the vertex coordinate) to perform a smooth step (Smoothstep node as shown in Figure 6) to obtain the corresponding vertex The specific calculation process of the first dynamic control parameter of the pixel is not described in detail in this application.

可选的,在获取动态控制参数后,还可以控制虚拟对象模型的边缘颜色渐变控制梯度,将其与溶解参数求和运算(如图6所示的Add节点的运算),将得到的对应渐变控制参数(可以将其输入图6中Smoothstep节点的边缘Edge(2)端)与上述动态控制参数、第一坐标值进行一次平滑阶跃,得到对应顶点像素的第一坐标值的消融控制参数,用以实现后续的颜色混合和顶点扰动处理。Optionally, after obtaining the dynamic control parameters, you can also control the edge color gradient control gradient of the virtual object model, and sum it with the dissolution parameter (the operation of the Add node as shown in Figure 6), and the obtained corresponding gradient The control parameter (which can be input into the Edge (2) end of the Smoothstep node in Fig. 6) performs a smooth step with the above-mentioned dynamic control parameter and the first coordinate value to obtain the ablation control parameter of the first coordinate value of the corresponding vertex pixel, Used to achieve subsequent color mixing and vertex perturbation processing.

对于虚拟对象模型的边缘扰动,可以采用噪声信号实现,对此,本申请可以创建一个噪声节点,以获得针对虚拟对象模型的边缘噪声。可选的,如图7所示,创建Simple Noise节点,通过定时器Time控制UV中的V分量做偏移,实现对虚拟对象模型边缘的扰动,根据实际需要,可以使用乘运算Multiply节点进行噪声信号削弱处理等,以得到虚拟对象模型的边缘噪声,本申请对该边缘噪声的获取方法不做详述。The edge perturbation of the virtual object model can be realized by using a noise signal. For this, the present application can create a noise node to obtain the edge noise for the virtual object model. Optionally, as shown in Figure 7, create a Simple Noise node, and use the timer Time to control the V component in the UV to offset, so as to realize the disturbance to the edge of the virtual object model. According to actual needs, you can use the Multiply node to perform noise Signal attenuation processing, etc., to obtain the edge noise of the virtual object model, the method for obtaining the edge noise will not be described in detail in this application.

按照但并不局限于上文描述的方法,获得消融边缘值、第一动态控制参数以及针对虚拟对象模型的边缘噪声等多个模型数据后,可以据此实现AlphaClip控制,以使虚拟对象模型的边缘颗粒是随机的,为后续按照溶解方向的灰烬飘散效果做准备。因此,如图8所示,本申请可以将边缘噪声与第一动态控制参数(即滑块控制参数)相加(如图8中Add节点的运算),将输出参数输入Step节点的In(1)端,同时将各顶点像素点的消融边缘值输入Step节点的Edge(1)端进行一个Step阶跃,在溶解方向上得到颗粒感的边界,对阶跃处理结果进行反向运算(图8中的圆形图中黑色表示透明,白色表示不透明),得到该溶解方向上的第一特效处理参数,作为AlphaClip输入参数,即输入片元Fragment的Alpha ClipThreshold(1)端,之后,就可以通过该参数与Alpha(可以记为预设消融阈值,通常取值为0.5)的大小关系,确定对应顶点像素颜色是否被丢弃,该顶点像素位置处是否为镂空。According to but not limited to the method described above, after obtaining multiple model data such as the ablation edge value, the first dynamic control parameter, and the edge noise for the virtual object model, AlphaClip control can be realized accordingly, so that the virtual object model The edge particles are random to prepare for the subsequent effect of ash drifting in the direction of dissolution. Therefore, as shown in Figure 8, the present application can add the edge noise to the first dynamic control parameter (i.e., the slider control parameter) (as shown in the calculation of the Add node in Figure 8), and input the output parameter to the In(1) of the Step node. ) terminal, and at the same time, input the ablation edge value of each vertex pixel point into the Edge(1) terminal of the Step node to perform a Step step, and obtain a grainy boundary in the direction of dissolution, and reverse the step processing result (Figure 8 In the circle diagram, black means transparent, and white means opaque), get the first special effect processing parameter in the dissolving direction, and use it as the input parameter of AlphaClip, that is, input the Alpha ClipThreshold(1) end of Fragment, after that, you can pass The relationship between this parameter and Alpha (which can be recorded as the preset ablation threshold, usually 0.5) determines whether the corresponding vertex pixel color is discarded, and whether the vertex pixel position is hollowed out.

步骤S35,通过片元着色器对第一特效处理参数、预设消融阈值、特效背景图以及顶点着色器输出的顶点数据进行特效渲染,以使得虚拟对象在溶解方向上展示消融特效。Step S35 , perform special effect rendering on the first special effect processing parameters, preset ablation threshold, special effect background image, and vertex data output by the vertex shader through the fragment shader, so that the virtual object displays the special effect of ablation in the dissolving direction.

本申请实施例中,该特效背景图可以是通过对虚拟对象模型的对象贴图进行处理得到,具体处理实现方法不做限时。可选的,由于上述第一动态控制参数获取过程中,结合了控制边缘颜色渐变梯度的控制参数,即该第一动态控制参数表征了边缘渐变效果,这样,在获取特效背景图的过程中,如图9所示,可以选择针对虚拟对象模型的对象贴图的背景色,如Color节点所选择的颜色,将其与第一动态控制参数进行混合后,再进行倍数加强(如Multiply节点的相乘运算),得到一个边缘渐变色。In the embodiment of the present application, the special effect background image may be obtained by processing the object texture of the virtual object model, and there is no time limit for the specific processing implementation method. Optionally, since the above-mentioned first dynamic control parameter acquisition process combines the control parameters for controlling the edge color gradient gradient, that is, the first dynamic control parameter represents the edge gradient effect, thus, in the process of acquiring the special effect background image, As shown in Figure 9, you can select the background color of the object map for the virtual object model, such as the color selected by the Color node, mix it with the first dynamic control parameter, and then perform multiplier enhancement (such as the multiplication of the Multiply node operation) to get an edge gradient color.

之后,如图10所示,可以将上述边缘渐变色与虚拟对象模型的对象贴图进行处理,如对该对象贴图进行采样,将采样所得到图片与边缘渐变色进行混合,得到特效背景图,即使得虚拟对象模型的对象贴图的边缘颜色渐变,丰富特效效果。需要说明,在不需要边缘颜色渐变的情况下,在上述获取特效背景图的过程中,可以不用执行边缘渐变色获取步骤,同理,在获得上述第一动态控制参数过程中,也可以不同结合边缘渐变梯度的控制参数,这样,可以直接将控制边缘消融程度的第一动态控制参数,与对象贴图的采样图片进行混合,得到所需的特效背景图,即片元着色器的基础色Base Color。Afterwards, as shown in Figure 10, the above-mentioned edge gradient color can be processed with the object texture of the virtual object model, such as sampling the object texture, and mixing the sampled image with the edge gradient color to obtain a special effect background image, even Get the edge color gradient of the object map of the virtual object model, enrich the special effects. It should be noted that, in the case where the edge color gradient is not required, the step of obtaining the edge gradient color may not be performed in the above process of obtaining the special effect background image. Similarly, in the process of obtaining the above first dynamic control parameter, different combinations may also be made. The control parameter of the edge gradient gradient, so that the first dynamic control parameter that controls the degree of edge ablation can be directly mixed with the sampled image of the object texture to obtain the required special effect background image, that is, the base color of the fragment shader. .

其中,如图10所示,按照上文描述的方法,可以将得到的第一特效处理参数、预设消融阈值和特效背景图输入片元着色器(如图10所示的Fragment节点),结合顶点着色器输出的顶点数据,如顶点像素在屏幕输出的空间坐标,本申请对该顶点数据的获取方法不做详述。片元着色器依据获得的多方面数据进行渲染,确定虚拟对象模型中各顶点像素的最终颜色,使得虚拟对象在所选择的溶解方向上以粒子形式展示消融特效,本申请对片元着色器和顶点着色器的工作原理不做详述。Among them, as shown in Figure 10, according to the method described above, the obtained first special effect processing parameters, preset ablation threshold and special effect background image can be input into the fragment shader (the Fragment node shown in Figure 10), combined with The vertex data output by the vertex shader, such as the spatial coordinates of the vertex pixels output on the screen, the method for obtaining the vertex data will not be described in detail in this application. The fragment shader renders according to the acquired multi-faceted data, and determines the final color of each vertex pixel in the virtual object model, so that the virtual object displays the ablation effect in the form of particles in the selected dissolution direction. This application applies to the fragment shader and The working principle of the vertex shader is not described in detail.

综上,在本申请实施例中,在需要虚拟对象以粒子形式展示消融特效时,可以灵活选择展示消融特效的溶解方向,结合所选择的溶解方向,获得虚拟对象模型的各顶点像素的消融边缘值,之后,结合用于控制各顶点像素在该溶解方向上的消融程度的第一动态控制参数,以及用于实现边缘扰动的边缘噪声,获得对应溶解方向上的第一特效处理参数,这样,片元着色器对该第一特效处理参数、预设消融阈值、特效背景图以及顶点数据进行特效渲染,从而使得虚拟对象模型的对象贴图可以按照该溶解方向,以粒子形式从边缘开始逐渐消融,丰富了虚拟对象的溶解特效展示效果。To sum up, in the embodiment of this application, when the virtual object needs to display the ablation special effect in the form of particles, the dissolution direction for displaying the ablation special effect can be flexibly selected, and combined with the selected dissolution direction, the ablation edge of each vertex pixel of the virtual object model can be obtained Afterwards, combined with the first dynamic control parameter used to control the ablation degree of each vertex pixel in the dissolving direction, and the edge noise used to realize the edge disturbance, the first special effect processing parameter corresponding to the dissolving direction is obtained. In this way, The fragment shader performs special effect rendering on the first special effect processing parameters, preset ablation threshold, special effect background image and vertex data, so that the object texture of the virtual object model can be gradually ablated from the edge in the form of particles according to the dissolution direction, Enriched the display effect of the dissolution effect of the virtual object.

参照图11,为本申请提出的虚拟对象的特效处理方法的又一可选示例的流程示意图,该方法可以是对上文提出的虚拟对象的特效处理方法的一可选细化实现方式进行描述,本实施例可以对上文提出的消融边缘值的获取过程进行细化描述,关于使用该消融边缘值实现虚拟对象的特效处理的其他执行步骤,可以参照上下文对应部分的描述,本实施例不做详述。基于此,参照图5所示的各顶点像素的消融边缘值的获取过程示意图,如图11所示,该消融边缘值的获取过程可以包括:Referring to FIG. 11 , it is a schematic flowchart of another optional example of the method for processing special effects of virtual objects proposed in this application. This method can describe an optional detailed implementation of the method for processing special effects of virtual objects proposed above. , this embodiment can describe in detail the acquisition process of the ablation edge value proposed above. For other execution steps of using the ablation edge value to realize the special effect processing of the virtual object, you can refer to the description of the corresponding part of the context. This embodiment does not Do elaborate. Based on this, referring to the schematic diagram of the acquisition process of the ablation edge value of each vertex pixel shown in FIG. 5, as shown in FIG. 11, the acquisition process of the ablation edge value may include:

步骤S111,从选择的虚拟对象模型的溶解方向的第一个顶点像素开始,将各顶点像素的第一坐标值与消融动态阈值进行比较,得到当前消融时刻对应像素点的消融边缘值;Step S111, starting from the first vertex pixel in the dissolving direction of the selected virtual object model, comparing the first coordinate value of each vertex pixel with the ablation dynamic threshold to obtain the ablation edge value of the corresponding pixel at the current ablation moment;

关于各顶点像素的第一坐标值的获取过程,可以参照上文描述的Position节点和Split节点的处理过程,可以获得各顶点像素的顶点坐标中与所选择的溶解方向一致的坐标轴的坐标,如y轴上的坐标值记为第一坐标值,或x轴上的坐标值即为第二坐标值等,对于不同坐标分量的后续处理过程,以及不同溶解方向上的消融特效处理过程类似,本申请不做一一举例详述,仍以提取第一坐标值为例进行说明。Regarding the acquisition process of the first coordinate value of each vertex pixel, you can refer to the processing process of the Position node and the Split node described above, and you can obtain the coordinate axis coordinates in the vertex coordinates of each vertex pixel that are consistent with the selected dissolution direction, For example, the coordinate value on the y-axis is recorded as the first coordinate value, or the coordinate value on the x-axis is the second coordinate value, etc. The subsequent processing process for different coordinate components and the ablation special effect processing process in different dissolution directions are similar. This application does not give detailed descriptions with examples one by one, and still takes extracting the first coordinate value as an example for illustration.

按照上述方法,获得每个顶点像素的世界坐标的位置后,可以在ShaderGraph中按照本申请提出的方法实现Edge值的计算。如图5所示,在不同消融时刻,可以将虚拟对象模型的各顶点像素的第一坐标值与对应的消融动态阈值进行比较,获得能够表征对应消融时刻的顶点像素的消融程度的消融边缘值,实现过程不做详述。According to the above method, after obtaining the position of the world coordinates of each vertex pixel, the calculation of the Edge value can be realized in ShaderGraph according to the method proposed in this application. As shown in Figure 5, at different ablation moments, the first coordinate value of each vertex pixel of the virtual object model can be compared with the corresponding ablation dynamic threshold to obtain an ablation edge value that can characterize the ablation degree of the vertex pixel at the corresponding ablation moment , the implementation process will not be described in detail.

步骤S112,按照预设规则,获得下一消融时刻对应的消融动态阈值;Step S112, according to preset rules, obtain the ablation dynamic threshold corresponding to the next ablation moment;

随着消融时间的增加,会按照预设规则慢慢减小消融动态阈值,由于虚拟对象模型的对象贴图是确定的,其具有的各顶点像素在某一消融方向上的坐标值确定,这样,在消融动态阈值不断减小的过程中,第一坐标值大于该消融动态阈值的顶点像素数量越来越多,且这类顶点像素的第一坐标值与消融动态阈值的差值也越来越大,对应顶点像素的消融程度越来越大,直至其颜色属性变为透明。As the ablation time increases, the ablation dynamic threshold will be gradually reduced according to the preset rules. Since the object texture of the virtual object model is determined, the coordinate values of each vertex pixel in a certain ablation direction are determined. In this way, In the process of decreasing the ablation dynamic threshold, the number of vertex pixels whose first coordinate value is greater than the ablation dynamic threshold is increasing, and the difference between the first coordinate value of such vertex pixels and the ablation dynamic threshold is also increasing. Larger, the corresponding vertex pixel is ablated more and more until its color attribute becomes transparent.

可选的,步骤S112的实现过程可以包括但并不局限于:获取虚拟对象模型的对象贴图在溶解方向上各顶点像素的第一最大坐标值和第一最小坐标值;通过插值方式,从第一最大坐标值到第一最小坐标值的范围内,顺次获得对应消融时刻的消融动态阈值,也就是说,随着消融时间增加,可以从第一最大坐标值开始,通过插值方式逐渐减小取值,得到小于上一消融时刻的消融动态阈值的当前消融时刻的消融动态阈值。Optionally, the implementation process of step S112 may include but is not limited to: obtaining the first maximum coordinate value and the first minimum coordinate value of each vertex pixel in the dissolving direction of the object map of the virtual object model; Within the range from the first maximum coordinate value to the first minimum coordinate value, the ablation dynamic threshold corresponding to the ablation time is sequentially obtained, that is to say, as the ablation time increases, it can start from the first maximum coordinate value and gradually decrease through interpolation The value is obtained to obtain the ablation dynamic threshold at the current ablation moment that is smaller than the ablation dynamic threshold at the last ablation moment.

示例性的,以从上向下的溶解方向为例进行说明,假设虚拟对象模型的对象贴图为正方形图片,其高度为4,该对象贴图的顶端像素位置MaxY(即第一最大坐标值)=图片中心位置(transform.position.Y)+图片高度的一半(即2),同理,该对象贴图的末端像素位置MinY(即第一最小坐标值)=图片中心位置(transform.position.Y)-图片高度的一半(即2)。应该理解的是,对于其他形状的对象贴图,可以依据相应的数学运算方式,计算得到所选择溶解方向上的最大坐标值和最小坐标值,计算过程本申请不做一一举例详述。Exemplarily, the dissolving direction from top to bottom is taken as an example for illustration, assuming that the object texture of the virtual object model is a square image with a height of 4, the top pixel position MaxY (ie, the first maximum coordinate value) of the object texture = Image center position (transform.position.Y) + half of the image height (ie 2), similarly, the end pixel position MinY of the object map (ie the first minimum coordinate value) = image center position (transform.position.Y) - half the image height (ie 2). It should be understood that for object maps of other shapes, the maximum and minimum coordinate values in the selected dissolving direction can be calculated according to corresponding mathematical operation methods, and the calculation process will not be described in detail in this application.

基于此,在1秒内从上向下的溶解过程中,消融时间T可以从0递增到1秒,使用lerp插值函数,将动态消融阈值StartY值由MaxY慢慢减小到MinY,相当于是将该StartY值从对象贴图的最上方位置移动到最小方位置,StartY值每往下移动一点,即StartY值每减小一点,StartY值以上位置的顶点像素就会慢慢变为透明,直至移动到最底部后全部变为透明(即消失)为止。在该移动过程中,顶点像素位置越靠上,其透明度越高,直至透明度达到100%,即对应顶点像素消失。Based on this, during the dissolution process from top to bottom within 1 second, the ablation time T can be increased from 0 to 1 second. Using the lerp interpolation function, the dynamic ablation threshold StartY value is gradually reduced from MaxY to MinY, which is equivalent to The StartY value moves from the top position of the object map to the minimum square position. Every time the StartY value moves down, that is, every time the StartY value decreases, the vertex pixels above the StartY value will gradually become transparent until it moves to After the bottom, everything becomes transparent (that is, disappears). During the moving process, the higher the position of the vertex pixel, the higher its transparency, until the transparency reaches 100%, that is, the corresponding vertex pixel disappears.

同理,若所选择的溶解方向是从下向上逐渐消融,StartY值的取值过程类似,区别在于StartY值由对象贴图最下方移动到最上方时,StartY值将由MinY开始取值直至增加值MaxY,按照上述比较方式,动态调整各像素点的消融边缘值;在所选择的溶解方向是左右方向上的消融,该场景下,可以获得对象贴图的最右端像素位置MaxX(即第一最大坐标值)=图片中心位置(transform.position.X)+图片宽度的一半(即2);该对象贴图的最左端像素位置MinX(即第一最小坐标值)=图片中心位置(transform.position.X)-图片宽度的一半(即2),之后,在按照从右向左或从左向右的消融过程中,可以从当前确定的坐标值变化范围内,采用插值方式,动态获得对应时刻的StartX,实现过程本申请不做详述。Similarly, if the selected dissolving direction is gradually ablated from bottom to top, the value selection process of the StartY value is similar, the difference is that when the StartY value moves from the bottom of the object map to the top, the StartY value will start from MinY until it increases to MaxY , according to the above comparison method, dynamically adjust the ablation edge value of each pixel point; the selected dissolution direction is ablation in the left and right directions, in this scene, the rightmost pixel position MaxX of the object map can be obtained (that is, the first maximum coordinate value )=picture center position (transform.position.X)+half of the picture width (ie 2); the leftmost pixel position MinX of the object map (ie the first minimum coordinate value)=picture center position (transform.position.X) - Half of the image width (ie 2), after that, during the ablation process from right to left or from left to right, the StartX at the corresponding moment can be dynamically obtained by interpolation within the range of the currently determined coordinate value change, The implementation process is not described in detail in this application.

由此可见,在溶解方向为从上向下或从右向左的情况下,在虚拟对象模型的贴图对象的消融过程中,按照插值方式,动态获取的StartY或StartX会逐渐减小;反之,若溶解方向为从下向上或从左向右,在虚拟对象模型的贴图对象的消融过程中,动态获取的StartY或StartX会逐渐减大,本申请对步骤S112的实现过程不做限制。It can be seen that when the dissolution direction is from top to bottom or from right to left, during the ablation process of the texture object of the virtual object model, the dynamically acquired StartY or StartX will gradually decrease according to the interpolation method; otherwise, If the dissolving direction is from bottom to top or from left to right, during the ablation process of the texture object of the virtual object model, the dynamically acquired StartY or StartX will gradually decrease, and this application does not limit the implementation process of step S112.

步骤S113,将各顶点像素的第一坐标值与该下一消融时刻对应的消融动态阈值进行比较,得到下一消融时刻对应顶点像素的消融边缘值,直至完成该溶解方向上的最后一个顶点像素的消融。Step S113, compare the first coordinate value of each vertex pixel with the ablation dynamic threshold corresponding to the next ablation moment, and obtain the ablation edge value of the corresponding vertex pixel at the next ablation moment, until the last vertex pixel in the dissolution direction is completed of ablation.

如上述分析,为了获得虚拟对象模型的对象贴图在所选择溶解方向上的消融效果,即使得对象贴图的消融具有方向性,可以将各消融时刻对应的消融动态阈值,与顶点像素的对应坐标轴的坐标值进行比较,确定该顶点像素的消融边缘值。由于消融动态阈值会随着消融时间增加而改变,且该改变与溶解方向相关,按照这种处理方式,能够保证对象贴图在该溶解方向上的各顶点像素的消融边缘值逐渐增加,且同一消融时刻越靠近溶解方向开始边缘位置的顶点像素的消融边缘值越大,表征该位置的顶点像素溶解程度越大,越早被溶解消失。As analyzed above, in order to obtain the ablation effect of the object texture of the virtual object model in the selected direction of dissolution, that is, to make the ablation of the object texture directional, the ablation dynamic threshold corresponding to each ablation moment can be compared with the corresponding coordinate axis of the vertex pixel The coordinate values of the vertices are compared to determine the ablation edge value of the vertex pixel. Since the dynamic threshold of ablation will change with the increase of ablation time, and this change is related to the dissolution direction, according to this processing method, it can ensure that the ablation edge value of each vertex pixel of the object map in the dissolution direction gradually increases, and the same ablation The closer the time is to the starting edge position of the dissolution direction, the larger the ablation edge value of the vertex pixel is, the greater the degree of dissolution of the vertex pixel representing this position is, and the earlier it is dissolved and disappears.

参照图12,为本申请提出的虚拟对象的特效处理方法的又一可选示例的流程示意图,该方法可以是对上文提出的虚拟对象的特效处理方法的又一可选细化实现方式进行描述,如图12所示,该方法可以包括:Referring to FIG. 12 , it is a schematic flowchart of another optional example of the special effect processing method for virtual objects proposed in this application. Described, as shown in Figure 12, the method may include:

步骤S121,获得针对虚拟对象模型的消融特效处理请求;该消融特效处理请求包含对虚拟对象模型的至少一个溶解方向;Step S121, obtaining an ablation special effect processing request for the virtual object model; the ablation special effect processing request includes at least one dissolution direction for the virtual object model;

步骤S122,响应该消融特效处理请求,获得虚拟对象模型的各顶点像素的顶点坐标,确定与该溶解方向一致的坐标轴上的第一坐标值;Step S122, in response to the ablation special effect processing request, obtain the vertex coordinates of each vertex pixel of the virtual object model, and determine the first coordinate value on the coordinate axis consistent with the dissolution direction;

步骤S123,依据该第一坐标值与对应坐标轴上的消融动态阈值之间的比较结果,获得对应像素的消融边缘值;Step S123, according to the comparison result between the first coordinate value and the ablation dynamic threshold on the corresponding coordinate axis, obtain the ablation edge value of the corresponding pixel;

关于步骤S121-步骤S123的实现过程,可以参照上文实施例相应部分的描述,包括但并不局限于图5所示的顶点坐标及其不同坐标轴上的坐标值的分离获取方式,以及据此动态更新各顶点像素的消融边缘,得到具有所选择的溶解方向的消融效果。Regarding the implementation process of step S121-step S123, you can refer to the description of the corresponding part of the above embodiment, including but not limited to the separation and acquisition of the vertex coordinates and the coordinate values on different coordinate axes shown in FIG. This dynamically updates the ablation edge for each vertex pixel, resulting in an ablation effect with the selected dissolve direction.

步骤S124,获得针对虚拟对象模型的在该溶解方向上的第一动态控制参数;Step S124, obtaining the first dynamic control parameter in the dissolving direction for the virtual object model;

步骤S125,对第一动态控制参数和预设边缘颜色渐变梯度控制参数进行融合处理,得到边缘控制参数;Step S125, performing fusion processing on the first dynamic control parameter and the preset edge color gradient control parameter to obtain the edge control parameter;

步骤S126,对边缘控制参数、第一动态控制参数以及第一坐标值进行平滑阶跃运算,得到在溶解方向上的消融控制参数;Step S126, performing a smooth step operation on the edge control parameter, the first dynamic control parameter and the first coordinate value, to obtain the ablation control parameter in the dissolution direction;

参照上文图6所示的处理方法,为了动态控制消融程度,可以配置对应的第一动态控制参数,之后,可以配置边缘颜色渐变梯度的预设控制参数,将处理结果作为Smoothstep节点的输入,以实现虚拟对象模型的消融方向的边缘的颜色渐变效果,实现过程可以参照上文实施例对应部分的描述,本实施例不做赘述。其中,该Smoothstep节点输出的消融控制参数可以用于后续颜色混合和顶点扰动处理的输入参数。Referring to the processing method shown in Figure 6 above, in order to dynamically control the degree of ablation, the corresponding first dynamic control parameters can be configured, and then the preset control parameters of the edge color gradient can be configured, and the processing result can be used as the input of the Smoothstep node. In order to realize the color gradient effect of the edge of the ablation direction of the virtual object model, the realization process may refer to the description of the corresponding part of the above embodiment, which will not be described in detail in this embodiment. Wherein, the ablation control parameters output by the Smoothstep node can be used as input parameters for subsequent color mixing and vertex perturbation processing.

步骤S127,获取随机噪声,对该随机噪声进行像素色度偏移处理,得到针对虚拟对象模型的对象贴图的边缘噪声;Step S127, obtaining random noise, performing pixel chroma shift processing on the random noise, and obtaining edge noise for the object map of the virtual object model;

本申请提出使用噪声(本申请是指噪声图像)对对象贴图的边缘进行扰动,对此,如图7所示,创建噪声Simple Noise节点,通过定时器控制UV偏移,得到所需的边缘噪声,具体处理实现过程可以参照上文实施例对应部分的描述,本实施例不做赘述。This application proposes to use noise (this application refers to the noise image) to disturb the edge of the object map. For this, as shown in Figure 7, create a noise Simple Noise node, and control the UV offset through a timer to obtain the required edge noise , for the specific processing and implementation process, refer to the description of the corresponding part of the above embodiment, and details are not described in this embodiment.

步骤S128,对第一动态控制参数和边缘噪声进行相加,得到边缘控制参数;Step S128, adding the first dynamic control parameter and the edge noise to obtain the edge control parameter;

步骤S129,依据阶跃函数,对边缘控制参数与消融边缘值进行处理,对处理结果进行反向处理,得到对应溶解方向上的第一特效处理参数;Step S129, according to the step function, process the edge control parameter and the ablation edge value, and reverse process the processing result to obtain the first special effect processing parameter corresponding to the dissolution direction;

关于步骤S128和步骤S129的实现过程,可以参照图8及其对应部分的描述,本实施例在此不做详述。Regarding the implementation process of step S128 and step S129, reference may be made to FIG. 8 and descriptions of corresponding parts thereof, and details are not described in this embodiment here.

步骤S1210,获得针对虚拟对象模型的各顶点像素的顶点坐标的扰动噪声;Step S1210, obtaining disturbance noise for the vertex coordinates of each vertex pixel of the virtual object model;

本申请可以对虚拟对象模型中,需要消融的区域的顶点做一个坐标扰动的效果,构造一个坐标扰动的扰动噪声,参照图13所示的顶点坐标扰动处理方法,可以采用SimpleNoise对顶点坐标的x和y轴的坐标值进行扰动,使用梯度渐变噪声Gradient Noise对y轴(以从上下方向的消融方向为例进行说明,若消融方向是左右方向,此处可以是x轴)坐标值进行扰动,但并不局限于图13所示的顶点坐标扰动处理方法。This application can make a coordinate perturbation effect on the vertices of the area that needs to be ablated in the virtual object model, and construct a disturbance noise of coordinate perturbation. Referring to the vertex coordinate perturbation processing method shown in Figure 13, SimpleNoise can be used for the x of the vertex coordinates Perturb the coordinate value of the y-axis, and use the gradient noise Gradient Noise to perturb the coordinate value of the y-axis (taking the ablation direction from the up and down direction as an example, if the ablation direction is the left-right direction, here can be the x-axis), But it is not limited to the vertex coordinate disturbance processing method shown in FIG. 13 .

步骤S1211,利用扰动噪声对顶点坐标的坐标值进行扰动处理,得到干扰顶点坐标;Step S1211, using disturbance noise to perform disturbance processing on the coordinate values of the vertex coordinates to obtain the disturbance vertex coordinates;

步骤S1212,依据消融控制参数,在原有的顶点坐标和干扰顶点坐标之间进行线性插值,得到目标顶点坐标;Step S1212, according to the ablation control parameters, perform linear interpolation between the original vertex coordinates and the interference vertex coordinates to obtain the target vertex coordinates;

步骤S1213,通过顶点着色器对目标顶点坐标进行处理,得到能够表征目标空间下的目标显示位置的顶点数据;Step S1213, process the target vertex coordinates through the vertex shader to obtain vertex data that can represent the target display position in the target space;

结合上文Position节点描述的顶点坐标获取方法,在获得虚拟对象模型的各顶点坐标后,如图14所示,可以按照上文描述的方法干扰噪声与顶点坐标进行相加,得到对应的干扰顶点坐标,之后,可以通过滑块控制(如上述得到的消融控制参数)进行线性插值,得到目标顶点坐标,将其输入至顶点着色器Vertex的Position端,结合目标空间配置参数对该目标顶点坐标进行转换处理,得到其在屏幕上的显示位置,即得到顶点的全局空间坐标,记为顶点数据,本申请对顶点着色器的工作原理不做详述。Combined with the vertex coordinate acquisition method described above in the Position node, after obtaining the vertex coordinates of the virtual object model, as shown in Figure 14, the interference noise can be added to the vertex coordinates according to the method described above to obtain the corresponding interference vertex Coordinates, after that, linear interpolation can be performed through the slider control (such as the ablation control parameters obtained above) to obtain the target vertex coordinates, which are input to the Position terminal of the vertex shader Vertex, and combined with the target space configuration parameters. Transformation process to obtain its display position on the screen, that is, to obtain the global space coordinates of the vertex, which is recorded as vertex data. This application does not describe the working principle of the vertex shader in detail.

其中,在上述步骤S1212的实现过程中,在Lerp函数中,A是经过干扰的顶点坐标位置,B是未干扰的顶点坐标位置,(T就是一个通过进度条控制的时间参数),插值函数表达的是在A与B之间进行插值计算,得到A与B之间的一个值,经过实时计算,所得到的这个值可以在A与B之间变化,最终体现所有顶点以无次序的形式,透明度由不透明到完全透明的效果。Wherein, in the implementation process of the above-mentioned step S1212, in the Lerp function, A is the vertex coordinate position through interference, and B is the undisturbed vertex coordinate position, (T is exactly a time parameter controlled by the progress bar), the interpolation function expression The purpose is to perform interpolation calculation between A and B to obtain a value between A and B. After real-time calculation, the obtained value can change between A and B, and finally reflect that all vertices are in an unordered form. Transparency ranges from opaque to fully transparent.

步骤S1214,通过片元着色器对第一特效处理参数、预设消融阈值、特效背景图以及顶点着色器输出的顶点数据进行特效渲染,以使得虚拟对象在溶解方向上展示消融特效。Step S1214, perform special effect rendering on the first special effect processing parameters, the preset ablation threshold, the special effect background image, and the vertex data output by the vertex shader through the fragment shader, so that the virtual object displays the special effect of ablation in the dissolution direction.

综上,本申请实施例,经过片元着色器对各输入参数的吹,可以确定虚拟对象模型的对象贴图的各像素在最终颜色,使得该虚拟对象在所选择的溶解方向上,以粒子形式展示消融特效,丰富了不同虚拟对象的消融特性的展示效果,提高了用户体验。To sum up, in the embodiment of this application, after blowing the input parameters of the fragment shader, the final color of each pixel of the object map of the virtual object model can be determined, so that the virtual object can be displayed in the form of particles in the selected dissolution direction. Displaying special effects of ablation enriches the display effect of ablation characteristics of different virtual objects and improves user experience.

参照图15,为本申请提出的虚拟对象的特效处理装置的一可选示例的结构示意图,该装置可以包括:Referring to FIG. 15 , it is a schematic structural diagram of an optional example of a virtual object special effect processing device proposed in this application, which may include:

消融特效处理请求获得模块151,用于获得针对虚拟对象模型的消融特效处理请求;所述消融特效处理请求包含对所述虚拟对象模型的至少一个溶解方向;An ablation special effect processing request obtaining module 151, configured to obtain an ablation special effect processing request for a virtual object model; the ablation special effect processing request includes at least one dissolution direction for the virtual object model;

第一坐标值获得模块152,用于响应所述消融特效处理请求,获得所述虚拟对象模型的各顶点像素的第一坐标值;所述第一坐标值是指与所述溶解方向一致的坐标轴上的坐标值;The first coordinate value obtaining module 152 is configured to respond to the ablation special effect processing request and obtain the first coordinate value of each vertex pixel of the virtual object model; the first coordinate value refers to the coordinate consistent with the dissolution direction coordinate value on the axis;

消融边缘值获得模块153,用于依据所述第一坐标值与对应坐标轴上的消融动态阈值之间的比较结果,获得对应顶点像素的消融边缘值;所述消融边缘值的大小能够表征所述对象贴图上对应像素点的消融程度,所述消融动态阈值能够随消融时间的增加而改变;The ablation edge value obtaining module 153 is used to obtain the ablation edge value of the corresponding vertex pixel according to the comparison result between the first coordinate value and the ablation dynamic threshold on the corresponding coordinate axis; the size of the ablation edge value can represent the The ablation degree of the corresponding pixel on the object map, the ablation dynamic threshold can change with the increase of ablation time;

第一特效处理参数得到模块154,用于对所述消融边缘值、第一动态控制参数以及针对所述虚拟对象模型的边缘噪声进行处理,得到对应所述溶解方向上的第一特效处理参数;所述第一动态控制参数用于控制对应顶点像素在所述溶解方向上的消融程度;The first special effect processing parameter obtaining module 154 is configured to process the ablation edge value, the first dynamic control parameter and the edge noise for the virtual object model to obtain the first special effect processing parameter corresponding to the dissolution direction; The first dynamic control parameter is used to control the ablation degree of the corresponding vertex pixel in the dissolving direction;

特效渲染模块155,用于通过片元着色器对所述第一特效处理参数、预设消融阈值、特效背景图以及顶点着色器输出的顶点数据进行特效渲染,以使得所述虚拟对象在所述溶解方向上展示消融特效;所述特效背景图是通过对所述虚拟对象模型的对象贴图处理得到。The special effect rendering module 155 is configured to perform special effect rendering on the first special effect processing parameters, the preset ablation threshold, the special effect background map, and the vertex data output by the vertex shader through the fragment shader, so that the virtual object is rendered in the The ablation special effect is displayed in the dissolving direction; the background image of the special effect is obtained by processing the object texture of the virtual object model.

可选的,消融边缘值获得模块153可以包括:Optionally, the ablation edge value obtaining module 153 may include:

第一比较单元,用于从所述溶解方向的第一个顶点像素开始,将各顶点像素的所述第一坐标值与消融动态阈值进行比较,得到当前消融时刻对应顶点像素的消融边缘值;The first comparison unit is configured to compare the first coordinate value of each vertex pixel with the ablation dynamic threshold starting from the first vertex pixel in the dissolving direction, to obtain the ablation edge value of the corresponding vertex pixel at the current ablation moment;

消融动态阈值获得单元,用于按照预设规则,获得下一消融时刻对应的消融动态阈值;The ablation dynamic threshold obtaining unit is configured to obtain the ablation dynamic threshold corresponding to the next ablation moment according to preset rules;

第二比较单元,用于将所述各顶点像素的所述第一坐标值与所述下一消融时刻对应的消融动态阈值进行比较,得到下一消融时刻对应顶点像素的消融边缘值,直至完成所述溶解方向上的最后一个顶点像素的消融。The second comparison unit is configured to compare the first coordinate value of each vertex pixel with the ablation dynamic threshold corresponding to the next ablation moment, to obtain the ablation edge value of the corresponding vertex pixel at the next ablation moment, until the completion The ablation of the last vertex pixel in the dissolve direction.

可选的,上述消融动态阈值获得单元可以包括:Optionally, the ablation dynamic threshold obtaining unit may include:

坐标值获取单元,用于获取所述虚拟对象模型的对象贴图在所述溶解方向上各顶点像素的第一最大坐标值和第一最小坐标值;A coordinate value acquisition unit, configured to acquire the first maximum coordinate value and the first minimum coordinate value of each vertex pixel in the dissolution direction of the object map of the virtual object model;

插值获得单元,用于通过插值方式,从所述第一最大坐标值到所述第一最小坐标值的范围内,顺次获得对应消融时刻的消融动态阈值。The interpolation obtaining unit is configured to sequentially obtain the ablation dynamic threshold corresponding to the ablation moment within the range from the first maximum coordinate value to the first minimum coordinate value by interpolation.

在一些实施例中,在上述基础上,上述第一特效处理参数得到模块154可以包括:In some embodiments, based on the above, the first special effect processing parameter obtaining module 154 may include:

第一动态控制参数获得单元,用于获得针对所述虚拟对象模型的在所述溶解方向上的第一动态控制参数;a first dynamic control parameter obtaining unit, configured to obtain a first dynamic control parameter in the dissolving direction for the virtual object model;

边缘噪声得到单元,用于获取随机噪声,对所述随机噪声进行像素色度偏移处理,得到针对虚拟对象模型的对象贴图的边缘噪声;The edge noise obtaining unit is used to obtain random noise, and perform pixel chroma offset processing on the random noise to obtain edge noise for the object map of the virtual object model;

边缘控制参数得到单元,用于对所述第一动态控制参数和所述边缘噪声进行相加,得到边缘控制参数;an edge control parameter obtaining unit, configured to add the first dynamic control parameter and the edge noise to obtain an edge control parameter;

特效处理参数得到单元,用于依据阶跃函数,对所述边缘控制参数与所述消融边缘值进行处理,对处理结果进行反向处理,得到对应所述溶解方向上的第一特效处理参数。The special effect processing parameter obtaining unit is configured to process the edge control parameter and the ablation edge value according to a step function, reversely process the processing result, and obtain the first special effect processing parameter corresponding to the dissolution direction.

可选的,为了获得顶点着色器输出的顶点数据,上述装置还可以包括:Optionally, in order to obtain the vertex data output by the vertex shader, the above-mentioned device may further include:

扰动噪声获得模块,用于获得针对所述虚拟对象模型的各顶点像素的顶点坐标的扰动噪声;A disturbance noise obtaining module, configured to obtain disturbance noise for the vertex coordinates of each vertex pixel of the virtual object model;

干扰顶点坐标得到模块,用于利用所述扰动噪声对所述顶点坐标的坐标值进行扰动处理,得到干扰顶点坐标;The interfering vertex coordinate obtaining module is used to use the disturbance noise to perform disturbance processing on the coordinate values of the apex coordinates to obtain the interfering vertex coordinates;

目标顶点坐标得到模块,用于依据消融控制参数,在原有的所述顶点坐标和所述干扰顶点坐标之间进行线性插值,得到目标顶点坐标;所述消融控制参数至少依据所述第一动态控制参数获得;The target vertex coordinate obtaining module is used to perform linear interpolation between the original vertex coordinates and the interference vertex coordinates according to the ablation control parameters to obtain the target vertex coordinates; the ablation control parameters are at least based on the first dynamic control get parameters;

顶点数据得到模块,用于通过顶点着色器对所述目标顶点坐标进行处理,得到能够表征目标空间下的目标显示位置的顶点数据。The vertex data obtaining module is configured to process the target vertex coordinates through a vertex shader to obtain vertex data that can represent the display position of the target in the target space.

可选的,上述装置还可以包括:消融控制参数获得模块,用于至少依据所述第一动态控制参数,获得消融控制参数。在一些实施例中,消融控制参数获得模块可以包括:Optionally, the above device may further include: an ablation control parameter obtaining module, configured to obtain the ablation control parameter at least according to the first dynamic control parameter. In some embodiments, the ablation control parameter acquisition module may include:

边缘控制参数得到单元,用于对所述第一动态控制参数和预设边缘颜色渐变梯度控制参数进行融合处理,得到边缘控制参数;An edge control parameter obtaining unit, configured to perform fusion processing on the first dynamic control parameter and the preset edge color gradient control parameter to obtain the edge control parameter;

消融控制参数得到单元,用于对所述边缘控制参数、所述第一动态控制参数以及所述第一坐标值进行平滑阶跃运算,得到在所述溶解方向上的消融控制参数。The ablation control parameter obtaining unit is configured to perform a smooth step operation on the edge control parameter, the first dynamic control parameter and the first coordinate value to obtain the ablation control parameter in the dissolution direction.

需要说明的是,关于上述各装置实施例中的各种模块、单元等,均可以作为程序模块存储在存储器中,由处理器执行存储在存储器中的上述程序模块,以实现相应的功能,关于各程序模块及其组合所实现的功能,以及达到的技术效果,可以参照上述方法实施例相应部分的描述,本实施例不再赘述。It should be noted that the various modules, units, etc. in the above-mentioned device embodiments can all be stored in the memory as program modules, and the processor executes the above-mentioned program modules stored in the memory to realize corresponding functions. For the functions realized by each program module and its combination, as well as the technical effects achieved, reference may be made to the description of the corresponding parts of the above method embodiments, and details will not be repeated in this embodiment.

本申请实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器加载并执行,实现上述的虚拟对象的特效处理方法的各步骤,具体实现过程可以参照上述实施例相应部分的描述,本实施例不做赘述。The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and the computer program is loaded and executed by a processor to implement the steps of the above-mentioned special effect processing method for a virtual object. The specific implementation process can be Refer to the descriptions of the corresponding parts of the foregoing embodiments, and details are not described in this embodiment.

本申请还提出了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述虚拟对象的特效处理方法方面或虚拟对象的特效处理装置方面的各种可选实现方式中所提供方法,具体实现过程可以参照上述相应实施例的描述,不做赘述。The present application also proposes a computer program product or computer program, the computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes various options in the aspect of the special effect processing method of the virtual object or the special effect processing device of the virtual object. For the methods and specific implementation processes provided in the implementation manners, reference may be made to the descriptions of the above-mentioned corresponding embodiments, and details are not repeated here.

最后,需要说明,本说明书中各个实施例采用递进或并列的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置、计算机设备而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Finally, it needs to be explained that each embodiment in this specification is described in a progressive or parallel manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other . As for the devices and computer equipment disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and for relevant details, please refer to the description of the method part.

专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计预设条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Professionals can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the possible For interchangeability, in the above description, the composition and steps of each example have been generally described according to their functions. Whether these functions are performed by hardware or software depends on the specific application and design preset conditions of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.

对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本申请。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的核心思想或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the core idea or scope of the application. Therefore, the present application will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1.一种虚拟对象的特效处理方法,其特征在于,所述方法包括:1. A special effect processing method for a virtual object, characterized in that the method comprises: 获得针对虚拟对象模型的消融特效处理请求;所述消融特效处理请求包含对所述虚拟对象模型的至少一个溶解方向;Obtain an ablation special effect processing request for the virtual object model; the ablation special effect processing request includes at least one dissolution direction for the virtual object model; 响应所述消融特效处理请求,获得所述虚拟对象模型的各顶点像素的第一坐标值;所述第一坐标值是指与所述溶解方向一致的坐标轴上的坐标值;In response to the ablation special effect processing request, obtain a first coordinate value of each vertex pixel of the virtual object model; the first coordinate value refers to a coordinate value on a coordinate axis consistent with the dissolution direction; 依据所述第一坐标值与对应坐标轴上的消融动态阈值之间的比较结果,获得对应顶点像素的消融边缘值;所述消融边缘值的大小能够表征所述对象贴图上对应像素点的消融程度,所述消融动态阈值能够随消融时间的增加而改变;According to the comparison result between the first coordinate value and the ablation dynamic threshold on the corresponding coordinate axis, the ablation edge value of the corresponding vertex pixel is obtained; the size of the ablation edge value can represent the ablation of the corresponding pixel on the object map degree, the ablation dynamic threshold can change with the increase of ablation time; 对所述消融边缘值、第一动态控制参数以及针对所述虚拟对象模型的边缘噪声进行处理,得到对应所述溶解方向上的第一特效处理参数;所述第一动态控制参数用于控制对应顶点像素在所述溶解方向上的消融程度;Processing the ablation edge value, the first dynamic control parameter and the edge noise of the virtual object model to obtain the first special effect processing parameter corresponding to the dissolution direction; the first dynamic control parameter is used to control the corresponding The degree of ablation of vertex pixels in the direction of dissolution; 通过片元着色器对所述第一特效处理参数、预设消融阈值、特效背景图以及顶点着色器输出的顶点数据进行特效渲染,以使得所述虚拟对象在所述溶解方向上展示消融特效;所述特效背景图是通过对所述虚拟对象模型的对象贴图处理得到。performing special effect rendering on the first special effect processing parameters, the preset ablation threshold, the special effect background image, and the vertex data output by the vertex shader through the fragment shader, so that the virtual object displays an ablation special effect in the dissolution direction; The special effect background image is obtained through object mapping processing on the virtual object model. 2.根据权利要求1所述的方法,其特征在于,所述依据所述第一坐标值与对应坐标轴上的消融动态阈值之间的比较结果,获得对应顶点像素的消融边缘值,包括:2. The method according to claim 1, wherein the obtaining the ablation edge value of the corresponding vertex pixel according to the comparison result between the first coordinate value and the ablation dynamic threshold on the corresponding coordinate axis comprises: 从所述溶解方向的第一个顶点像素开始,将各顶点像素的所述第一坐标值与消融动态阈值进行比较,得到当前消融时刻对应顶点像素的消融边缘值;Starting from the first vertex pixel in the dissolving direction, comparing the first coordinate value of each vertex pixel with the ablation dynamic threshold to obtain the ablation edge value of the corresponding vertex pixel at the current ablation moment; 按照预设规则,获得下一消融时刻对应的消融动态阈值;According to the preset rules, the ablation dynamic threshold corresponding to the next ablation moment is obtained; 将所述各顶点像素的所述第一坐标值与所述下一消融时刻对应的消融动态阈值进行比较,得到下一消融时刻对应顶点像素的消融边缘值,直至完成所述溶解方向上的最后一个顶点像素的消融。Comparing the first coordinate value of each vertex pixel with the ablation dynamic threshold corresponding to the next ablation moment, obtaining the ablation edge value of the corresponding vertex pixel at the next ablation moment, until the final Ablation of a vertex pixel. 3.根据权利要求2所述的方法,其特征在于,所述按照预设规则,获得下一消融时刻对应的消融动态阈值,包括:3. The method according to claim 2, wherein the obtaining the dynamic threshold of ablation corresponding to the next ablation moment according to the preset rules comprises: 获取所述虚拟对象模型的对象贴图在所述溶解方向上各顶点像素的第一最大坐标值和第一最小坐标值;Acquiring the first maximum coordinate value and the first minimum coordinate value of each vertex pixel of the object map of the virtual object model in the dissolution direction; 通过插值方式,从所述第一最大坐标值到所述第一最小坐标值的范围内,顺次获得对应消融时刻的消融动态阈值。Through interpolation, within the range from the first maximum coordinate value to the first minimum coordinate value, ablation dynamic thresholds corresponding to ablation moments are sequentially obtained. 4.根据权利要求1-3任一项所述的方法,其特征在于,所述对所述消融边缘值、第一动态控制参数以及针对所述虚拟对象模型的边缘噪声进行处理,得到对应所述溶解方向上的第一特效处理参数,包括:4. The method according to any one of claims 1-3, characterized in that, the ablation edge value, the first dynamic control parameter and the edge noise for the virtual object model are processed to obtain the corresponding The first special effect processing parameters in the dissolution direction above, including: 获得针对所述虚拟对象模型的在所述溶解方向上的第一动态控制参数;obtaining a first dynamic control parameter in the dissolving direction for the virtual object model; 获取随机噪声,对所述随机噪声进行像素色度偏移处理,得到针对虚拟对象模型的对象贴图的边缘噪声;Obtain random noise, perform pixel chroma offset processing on the random noise, and obtain edge noise for the object map of the virtual object model; 对所述第一动态控制参数和所述边缘噪声进行相加,得到边缘控制参数;adding the first dynamic control parameter and the edge noise to obtain an edge control parameter; 依据阶跃函数,对所述边缘控制参数与所述消融边缘值进行处理,对处理结果进行反向处理,得到对应所述溶解方向上的第一特效处理参数。The edge control parameter and the ablation edge value are processed according to a step function, and the processing result is reversely processed to obtain a first special effect processing parameter corresponding to the dissolution direction. 5.根据权利要求4所述的方法,其特征在于,所述顶点着色器输出的顶点数据的获取过程包括:5. The method according to claim 4, wherein the obtaining process of the vertex data output by the vertex shader comprises: 获得针对所述虚拟对象模型的各顶点像素的顶点坐标的扰动噪声;Obtaining perturbation noise for vertex coordinates of each vertex pixel of the virtual object model; 利用所述扰动噪声对所述顶点坐标的坐标值进行扰动处理,得到干扰顶点坐标;Using the disturbance noise to perform disturbance processing on the coordinate values of the vertex coordinates to obtain the disturbance vertex coordinates; 依据消融控制参数,在原有的所述顶点坐标和所述干扰顶点坐标之间进行线性插值,得到目标顶点坐标;所述消融控制参数至少依据所述第一动态控制参数获得;Performing linear interpolation between the original vertex coordinates and the interference vertex coordinates according to the ablation control parameters to obtain target vertex coordinates; the ablation control parameters are obtained at least according to the first dynamic control parameters; 通过顶点着色器对所述目标顶点坐标进行处理,得到能够表征目标空间下的目标显示位置的顶点数据。The vertex coordinates of the target are processed by the vertex shader to obtain vertex data that can represent the display position of the target in the target space. 6.根据权利要求5所述的方法,其特征在于,所述至少依据所述第一动态控制参数,获得消融控制参数,包括:6. The method according to claim 5, wherein said obtaining ablation control parameters at least based on said first dynamic control parameters comprises: 对所述第一动态控制参数和预设边缘颜色渐变梯度控制参数进行融合处理,得到边缘控制参数;performing fusion processing on the first dynamic control parameter and the preset edge color gradient control parameter to obtain the edge control parameter; 对所述边缘控制参数、所述第一动态控制参数以及所述第一坐标值进行平滑阶跃运算,得到在所述溶解方向上的消融控制参数。A smooth step operation is performed on the edge control parameter, the first dynamic control parameter, and the first coordinate value to obtain an ablation control parameter in the dissolution direction. 7.一种虚拟对象的特效处理装置,其特征在于,所述装置包括:7. A special effect processing device for a virtual object, characterized in that the device comprises: 消融特效处理请求获得模块,用于获得针对虚拟对象模型的消融特效处理请求;所述消融特效处理请求包含对所述虚拟对象模型的至少一个溶解方向;An ablation special effect processing request obtaining module, configured to obtain an ablation special effect processing request for a virtual object model; the ablation special effect processing request includes at least one dissolution direction for the virtual object model; 第一坐标值获得模块,用于响应所述消融特效处理请求,获得所述虚拟对象模型的各顶点像素的第一坐标值;所述第一坐标值是指与所述溶解方向一致的坐标轴上的坐标值;The first coordinate value obtaining module is configured to respond to the ablation special effect processing request and obtain the first coordinate value of each vertex pixel of the virtual object model; the first coordinate value refers to a coordinate axis consistent with the dissolution direction coordinate value on 消融边缘值获得模块,用于依据所述第一坐标值与对应坐标轴上的消融动态阈值之间的比较结果,获得对应顶点像素的消融边缘值;所述消融边缘值的大小能够表征所述对象贴图上对应像素点的消融程度,所述消融动态阈值能够随消融时间的增加而改变;The ablation edge value obtaining module is used to obtain the ablation edge value of the corresponding vertex pixel according to the comparison result between the first coordinate value and the ablation dynamic threshold on the corresponding coordinate axis; the size of the ablation edge value can represent the The ablation degree of the corresponding pixel on the object map, the ablation dynamic threshold can change with the increase of ablation time; 第一特效处理参数得到模块,用于对所述消融边缘值、第一动态控制参数以及针对所述虚拟对象模型的边缘噪声进行处理,得到对应所述溶解方向上的第一特效处理参数;所述第一动态控制参数用于控制对应顶点像素在所述溶解方向上的消融程度;The first special effect processing parameter obtaining module is used to process the ablation edge value, the first dynamic control parameter and the edge noise for the virtual object model to obtain the first special effect processing parameter corresponding to the dissolution direction; The first dynamic control parameter is used to control the degree of ablation of the corresponding vertex pixel in the dissolution direction; 特效渲染模块,用于通过片元着色器对所述第一特效处理参数、预设消融阈值、特效背景图以及顶点着色器输出的顶点数据进行特效渲染,以使得所述虚拟对象在所述溶解方向上展示消融特效;所述特效背景图是通过对所述虚拟对象模型的对象贴图处理得到。The special effect rendering module is used to perform special effect rendering on the first special effect processing parameters, the preset ablation threshold, the special effect background image and the vertex data output by the vertex shader through the fragment shader, so that the virtual object dissolves in the The ablation effect is displayed in the direction; the background image of the special effect is obtained by processing the object texture of the virtual object model. 8.根据权利要求7所述的装置,其特征在于,所述消融边缘值获得模块包括:8. The device according to claim 7, wherein the ablation edge value obtaining module comprises: 第一比较单元,用于从所述溶解方向的第一个顶点像素开始,将各顶点像素的所述第一坐标值与消融动态阈值进行比较,得到当前消融时刻对应顶点像素的消融边缘值;The first comparison unit is configured to compare the first coordinate value of each vertex pixel with the ablation dynamic threshold starting from the first vertex pixel in the dissolving direction, to obtain the ablation edge value of the corresponding vertex pixel at the current ablation moment; 消融动态阈值获得单元,用于按照预设规则,获得下一消融时刻对应的消融动态阈值;The ablation dynamic threshold obtaining unit is configured to obtain the ablation dynamic threshold corresponding to the next ablation moment according to preset rules; 第二比较单元,用于将所述各顶点像素的所述第一坐标值与所述下一消融时刻对应的消融动态阈值进行比较,得到下一消融时刻对应顶点像素的消融边缘值,直至完成所述溶解方向上的最后一个顶点像素的消融。The second comparison unit is configured to compare the first coordinate value of each vertex pixel with the ablation dynamic threshold corresponding to the next ablation moment, to obtain the ablation edge value of the corresponding vertex pixel at the next ablation moment, until the completion The ablation of the last vertex pixel in the dissolve direction. 9.根据权利要求8所述的装置,其特征在于,所述消融动态阈值获得单元,包括:9. The device according to claim 8, wherein the ablation dynamic threshold obtaining unit comprises: 坐标值获取单元,用于获取所述虚拟对象模型的对象贴图在所述溶解方向上各顶点像素的第一最大坐标值和第一最小坐标值;A coordinate value acquisition unit, configured to acquire the first maximum coordinate value and the first minimum coordinate value of each vertex pixel in the dissolution direction of the object map of the virtual object model; 插值获得单元,用于通过插值方式,从所述第一最大坐标值到所述第一最小坐标值的范围内,顺次获得对应消融时刻的消融动态阈值。The interpolation obtaining unit is configured to sequentially obtain the ablation dynamic threshold corresponding to the ablation moment within the range from the first maximum coordinate value to the first minimum coordinate value by interpolation. 10.一种计算机设备,其特征在于,所述计算机设备包括:10. A computer device, characterized in that the computer device comprises: 通信模块;communication module; 存储器,用于存储如权利要求1-6任一项所述的虚拟对象的特效处理方法的程序;A memory for storing the program of the method for processing special effects of virtual objects according to any one of claims 1-6; 处理器,用于加载并执行所述存储器存储的所述程序,实现如权利要求1-6任一项所述的虚拟对象的特效处理方法的各步骤。The processor is configured to load and execute the program stored in the memory, so as to implement the steps of the special effect processing method for virtual objects according to any one of claims 1-6.
CN202211390772.1A 2022-11-07 2022-11-07 Virtual object special effects processing method, device and computer equipment Active CN115797528B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211390772.1A CN115797528B (en) 2022-11-07 2022-11-07 Virtual object special effects processing method, device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211390772.1A CN115797528B (en) 2022-11-07 2022-11-07 Virtual object special effects processing method, device and computer equipment

Publications (2)

Publication Number Publication Date
CN115797528A true CN115797528A (en) 2023-03-14
CN115797528B CN115797528B (en) 2025-05-16

Family

ID=85436042

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211390772.1A Active CN115797528B (en) 2022-11-07 2022-11-07 Virtual object special effects processing method, device and computer equipment

Country Status (1)

Country Link
CN (1) CN115797528B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118379420A (en) * 2024-06-26 2024-07-23 网易(杭州)网络有限公司 Display switching method, device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112070873A (en) * 2020-08-26 2020-12-11 完美世界(北京)软件科技发展有限公司 Model rendering method and device
CN112164121A (en) * 2020-09-30 2021-01-01 北京完美赤金科技有限公司 Tearing effect graph generation method and device, storage medium and electronic device
CN112233215A (en) * 2020-10-15 2021-01-15 网易(杭州)网络有限公司 Contour rendering method, apparatus, device and storage medium
CN112884874A (en) * 2021-03-18 2021-06-01 腾讯科技(深圳)有限公司 Method, apparatus, device and medium for applying decals on virtual model
CN113987739A (en) * 2021-09-10 2022-01-28 中国医学科学院肿瘤医院 Global ablation simulation method, device, storage medium and device for ablation needle
CN114119797A (en) * 2021-11-23 2022-03-01 北京世冠金洋科技发展有限公司 Data processing method and device, computer readable medium, processor and electronic equipment
WO2022141688A1 (en) * 2020-12-31 2022-07-07 杭州堃博生物科技有限公司 Ablation operation prompting method, electronic device, and computer-readable storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112070873A (en) * 2020-08-26 2020-12-11 完美世界(北京)软件科技发展有限公司 Model rendering method and device
CN112164121A (en) * 2020-09-30 2021-01-01 北京完美赤金科技有限公司 Tearing effect graph generation method and device, storage medium and electronic device
WO2022068040A1 (en) * 2020-09-30 2022-04-07 北京完美赤金科技有限公司 Method and apparatus for generating tear effect image, and storage medium and electronic apparatus
CN112233215A (en) * 2020-10-15 2021-01-15 网易(杭州)网络有限公司 Contour rendering method, apparatus, device and storage medium
WO2022141688A1 (en) * 2020-12-31 2022-07-07 杭州堃博生物科技有限公司 Ablation operation prompting method, electronic device, and computer-readable storage medium
CN112884874A (en) * 2021-03-18 2021-06-01 腾讯科技(深圳)有限公司 Method, apparatus, device and medium for applying decals on virtual model
CN113987739A (en) * 2021-09-10 2022-01-28 中国医学科学院肿瘤医院 Global ablation simulation method, device, storage medium and device for ablation needle
CN114119797A (en) * 2021-11-23 2022-03-01 北京世冠金洋科技发展有限公司 Data processing method and device, computer readable medium, processor and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118379420A (en) * 2024-06-26 2024-07-23 网易(杭州)网络有限公司 Display switching method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN115797528B (en) 2025-05-16

Similar Documents

Publication Publication Date Title
US9372593B2 (en) Using a three-dimensional model to render a cursor
JP7387758B2 (en) Interface display method, device, terminal, storage medium and computer program
US10481754B2 (en) Systems and methods for manipulating a 3D object in a 3D model using a software widget and surface constraints
US20100231590A1 (en) Creating and modifying 3d object textures
WO2023066121A1 (en) Rendering of three-dimensional model
WO2017092430A1 (en) Method and device for realizing user interface control based on virtual reality application
CN110322571B (en) Page processing method, device and medium
CN114119848A (en) A model rendering method, device, computer equipment and storage medium
US9483873B2 (en) Easy selection threshold
WO2021227684A1 (en) Method for selecting virtual objects, apparatus, terminal and storage medium
CN115797528A (en) Special effect processing method and device for virtual object and computer equipment
WO2025148650A1 (en) Game editing preview method and apparatus, storage medium, and electronic device
US12406447B2 (en) Multi-sided 3D portal
CN114663560B (en) Method, device, storage medium and electronic device for realizing animation of target model
CN117475053A (en) Grass rendering method and device
CN116485967A (en) Virtual model rendering method and related device
CN111462343B (en) Data processing method and device, electronic equipment and storage medium
US20240428523A1 (en) Techniques for sampling and remixing in immersive environments
US20240428537A1 (en) Techniques for sampling and remixing in immersive environments
CN114419233B (en) Model generation method, device, computer equipment and storage medium
CN116899216B (en) Processing method and device for special effect fusion in virtual scene
CN116112657B (en) Image processing method, image processing device, computer readable storage medium and electronic device
KR101598706B1 (en) Computing device and computer program for graphically expressing background of a game
JP2010134872A (en) Image processing method, image processing device, image processing program, and storage medium
CN119888039A (en) Rendering method, device, equipment, system, chip and medium

Legal Events

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