CN118096969A - A 3D design system based on Realibox engine - Google Patents

A 3D design system based on Realibox engine Download PDF

Info

Publication number
CN118096969A
CN118096969A CN202410184060.7A CN202410184060A CN118096969A CN 118096969 A CN118096969 A CN 118096969A CN 202410184060 A CN202410184060 A CN 202410184060A CN 118096969 A CN118096969 A CN 118096969A
Authority
CN
China
Prior art keywords
buffer
depth
realibox
design system
system based
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
CN202410184060.7A
Other languages
Chinese (zh)
Other versions
CN118096969B (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.)
Guangzhou Gravitational Wave Information Technology Co ltd
Original Assignee
Guangzhou Gravitational Wave Information Technology 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 Guangzhou Gravitational Wave Information Technology Co ltd filed Critical Guangzhou Gravitational Wave Information Technology Co ltd
Priority to CN202410184060.7A priority Critical patent/CN118096969B/en
Publication of CN118096969A publication Critical patent/CN118096969A/en
Application granted granted Critical
Publication of CN118096969B publication Critical patent/CN118096969B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

本发明公开了一种基于Realibox引擎的3D设计系统,包括以下步骤:步骤一:3D实时渲染;步骤二:性能优化;步骤三:数据存储和备份。本发明的有益效果是:在进行3D实时渲染的过程中先后经过清漆、透光、体积和顺序无关的半透明混合步骤,并在顺序无关的半透明混合步骤中进行半透明混合深度测试,通过半透明混合深度测试后才能结束混合步骤,进而使得半透明物体能够达到深度混合的效果,且通过设置的性能优化步骤,在本地缓存WebAssembly模块和脚本,以便在初次访问后加快加载速度,ktx纹理压缩工作流程并贴图转ktx提升场景性能;GPU实例化在每次绘制调用时渲染相同的网格,将每个实例具有不同的参数以增加变化并减少外观上的重复。

The invention discloses a 3D design system based on Realibox engine, comprising the following steps: step 1: 3D real-time rendering; step 2: performance optimization; step 3: data storage and backup. The invention has the following beneficial effects: in the process of 3D real-time rendering, varnish, light transmission, volume and order-independent translucent mixing steps are successively passed, and a translucent mixing depth test is performed in the order-independent translucent mixing step, and the mixing step can be ended only after the translucent mixing depth test is passed, so that the translucent object can achieve the effect of deep mixing, and through the set performance optimization steps, the WebAssembly module and script are cached locally to speed up the loading speed after the first access, the ktx texture compression workflow and map conversion to ktx improve the scene performance; GPU instantiation renders the same mesh at each drawing call, and each instance has different parameters to increase the variation and reduce the repetition in appearance.

Description

一种基于Realibox引擎的3D设计系统A 3D design system based on Realibox engine

技术领域Technical Field

本发明涉及一种3D设计系统,具体为一种基于Realibox引擎的3D设计系统,属于3D设计系统技术领域。The present invention relates to a 3D design system, in particular to a 3D design system based on a Realibox engine, belonging to the technical field of 3D design systems.

背景技术Background technique

在计算机将内容丰富、结构复杂、空间范围广阔的3D场景渲染到屏幕图像的过程中,中央处理器和图形处理器需要交互处理体量庞大的3D数据。In the process of computers rendering 3D scenes with rich content, complex structure and wide spatial range into screen images, the central processing unit and graphics processing unit need to interactively process huge amounts of 3D data.

现有的3D设计系统基于Three.js渲染库,对工业品装配关系及导入模型进行在线编辑,可快速简单地完成工业品3D建模。The existing 3D design system is based on the Three.js rendering library, which allows online editing of industrial product assembly relationships and imported models, and can quickly and easily complete 3D modeling of industrial products.

缺陷在于在进行3D实时渲染的过程中,需要先后进行清漆、透光和体积处理的步骤,进而需要很多半透明实体进行混合,在进行混合的过程中存在混合不完整的情况,同时3D设计系统的性能难以进行优化,因此我们提出了一种基于Realibox引擎的3D设计系统。The defect is that in the process of 3D real-time rendering, it is necessary to carry out varnish, light transmission and volume processing steps in sequence, which requires a lot of translucent entities to be mixed. In the process of mixing, there is incomplete mixing. At the same time, the performance of the 3D design system is difficult to optimize. Therefore, we proposed a 3D design system based on the Realibox engine.

发明内容Summary of the invention

本发明的目的就在于为了解决上述问题而提供一种基于Realibox引擎的3D设计系统,在进行3D实时渲染的过程中先后经过清漆、透光、体积和顺序无关的半透明混合步骤,并在顺序无关的半透明混合步骤中进行半透明混合深度测试,通过半透明混合深度测试后才能结束混合步骤,进而使得半透明物体能够达到深度混合的效果。The purpose of the present invention is to provide a 3D design system based on the Realibox engine in order to solve the above problems. In the process of 3D real-time rendering, varnish, light transmission, volume and order-independent translucent mixing steps are successively passed, and a translucent mixing depth test is performed in the order-independent translucent mixing step. The mixing step can only be ended after passing the semi-transparent mixing depth test, thereby enabling the translucent object to achieve a depth mixing effect.

本发明通过以下技术方案来实现上述目的,一种基于Realibox引擎的3D设计系统,包括以下步骤:The present invention achieves the above-mentioned purpose through the following technical solutions, a 3D design system based on Realibox engine, comprising the following steps:

步骤一:3D实时渲染,标准效果采用基于物理的渲染,实现跨不同环境的逼真、无缝的渲染结果;Step 1: 3D real-time rendering, standard effects use physically based rendering to achieve realistic and seamless rendering results across different environments;

步骤二:性能优化,对渲染性能进行优化;Step 2: Performance optimization, optimize rendering performance;

步骤三:数据存储和备份,对渲染数据进行存储和备份。Step 3: Data storage and backup, store and back up the rendering data.

优选的,所述3D实时渲染包括:Preferably, the 3D real-time rendering includes:

步骤一:清漆;Step 1: Varnish;

步骤二:透光;Step 2: Light transmission;

步骤三:体积;Step 3: Volume;

步骤四:顺序无关的半透明混合。Step 4: Order-independent translucent blending.

优选的,所述清漆步骤具体为:Preferably, the varnishing step is specifically as follows:

基于各向同性GGX分布和微平面BRDF粗糙度,对于清漆材质物体的表面分为两部分,其中一部分是ClearCoatLayer,另一部分是BaseLayer,一束光入射到表面,一部分光直接反射出去ClearCoat高光,另一部分进入BaseLayer,再分为漫反射与GGX高光反射出去。Based on the isotropic GGX distribution and microfacet BRDF roughness, the surface of the varnish material object is divided into two parts, one is the ClearCoatLayer and the other is the BaseLayer. When a beam of light is incident on the surface, part of the light is directly reflected as the ClearCoat highlight, and the other part enters the BaseLayer and is divided into diffuse reflection and GGX highlight reflection.

优选的,所述透光步骤具体为:Preferably, the light transmission step is specifically:

利用transmission将specular_btdf添加到核心BRDF。Add specular_btdf to the core BRDF using transmission.

优选的,所述体积步骤具体为:Preferably, the volume step is specifically:

各种对象的渲染以及场景中相应的自上而下切片,实线代表网格,灰色区域代表体积,薄壁材料应用于开放式和封闭式网格,虚线表示无限薄体积的假想边界,体积材质应用于闭合网格,从而产生折射的体积效果。Rendering of various objects and the corresponding top-down slice through the scene. Solid lines represent meshes, grey areas represent volumes, thin-walled materials are applied to open and closed meshes, dashed lines represent imaginary boundaries of infinitely thin volumes, and volumetric materials are applied to closed meshes, creating a volumetric effect of refraction.

优选的,所述顺序无关的半透明混合步骤具体为:Preferably, the order-independent semi-transparent mixing step is specifically:

over从后往前一层层叠加,而under则是从前往后一层层叠加;Over is stacked from back to front, while under is stacked from front to back.

从近到远设置有c-b-a三层There are three layers from near to far: c-b-a

over操作:先将ab叠加,再与c叠加;Over operation: first superimpose ab, then superimpose with c;

under操作:先将bc叠加,再与a叠加;Under operation: first superimpose bc, then superimpose with a;

从前往后逐层对半透明物体执行under操作,使所有要渲染的半透明物体都混合为一层,最后与底层的不透明物体执行over操作。The under operation is performed on the semi-transparent objects layer by layer from front to back, so that all the semi-transparent objects to be rendered are mixed into one layer, and finally the over operation is performed with the opaque objects at the bottom layer.

优选的,所述半透明混合深度测试步骤如下:Preferably, the semi-transparent mixed depth test steps are as follows:

步骤一、无序遍历所有物体执行深度测试,将最近的片元深度写入z-buffer;Step 1: Perform depth testing on all objects in an unordered manner and write the depth of the nearest fragment into the z-buffer.

步骤二、无序遍历半透明物体,比较片元深度与z-buffer的深度,若相同则将半透明片元颜色与color-buffer执行under,第一次执行时,直接写入color-buffer即可,同时将半透明片元透明度写入a-buffer,并标记片元的深度为一个特定值,代表此层剥离;Step 2: Traverse the semi-transparent objects in an unordered manner, compare the depth of the fragment with the depth of the z-buffer, and if they are the same, execute under the color-buffer with the color-buffer. When executing for the first time, write directly into the color-buffer, write the transparency of the semi-transparent fragment into the a-buffer, and mark the depth of the fragment as a specific value, indicating that this layer is peeled off;

步骤三、同步骤一,无序遍历所有物体执行深度测试,将最近的片元深度写入z-buffer;Step 3: Same as step 1, traverse all objects in an unordered manner to perform depth testing, and write the depth of the nearest fragment into the z-buffer;

步骤四、无序遍历半透明物体,比较片元深度与z-buffer的深度,若相同,则将半透明片元颜色与color-buffer执行under,将混合后的颜色和透明度写入color-buffer和a-buffer,并标记片元的深度为特定值,代表此层剥离;Step 4: Traverse the semi-transparent objects in an unordered manner, compare the depth of the fragment with the depth of the z-buffer, if they are the same, perform under on the color-buffer and write the mixed color and transparency into the color-buffer and a-buffer, and mark the depth of the fragment as a specific value, indicating that this layer is peeled off;

步骤五、重复步骤三-步骤四,满足任一个以下条件即可终止;Step 5: Repeat Step 3 to Step 4, and terminate when any of the following conditions is met;

1、遍历半透明物体时,所有片元的深度都和z-buffer不相等,代表碰到不透明物体;1. When traversing a translucent object, the depth of all fragments is not equal to the z-buffer, which means that an opaque object is encountered;

2、由于每次under后,a-buffer里面的透明度都会变大且接近于1,检测a-buffer里面都大于阈值;2. Since the transparency in a-buffer increases and approaches 1 after each under, the detection in a-buffer is greater than the threshold;

3、重复固定的次数;3. Repeat a fixed number of times;

步骤六、将不透明与半透明合为的一层进行混合;遍历不透明物体执行深度测试,将最近的不透明物体颜色与当前的color-buffer执行over操作。Step 6: Blend the opaque and translucent layers; traverse the opaque objects to perform depth testing, and perform an over operation on the color of the nearest opaque object and the current color-buffer.

优选的,所述性能优化包括以下步骤:Preferably, the performance optimization comprises the following steps:

步骤一:在本地缓存WebAssembly模块和脚本,以便在初次访问后加快加载速度;Step 1: Cache WebAssembly modules and scripts locally to speed up loading after the first visit;

步骤二:ktx纹理压缩,ktx纹理压缩工作流程并贴图转ktx提升场景性能;Step 2: ktx texture compression, ktx texture compression workflow and map conversion to ktx to improve scene performance;

步骤三:模型实例化,GPU实例化在每次绘制调用时渲染相同的网格,将每个实例具有不同的参数以增加变化并减少外观上的重复。Step 3: Model Instancing, GPU instancing renders the same mesh on each draw call, with each instance having different parameters to increase variation and reduce repetition in appearance.

优选的,所述模型实例化包括以下步骤:Preferably, the model instantiation comprises the following steps:

步骤一:创建需要实例化的模型对象和实例数量;Step 1: Create the model object and instance quantity to be instantiated;

步骤二:创建实例化模型对象并将模型作为Geomery对象的属性添加到该实例化模型对象中;Step 2: Create an instantiated model object and add the model as a property of the Geomery object to the instantiated model object;

步骤三:使用InstancedBufferGeometry类来创建实例化模型的几何体;该类将原始模型几何体作为参数,并为每个实例提供实例属性的缓冲区数据;Step 3: Use the InstancedBufferGeometry class to create the geometry of the instanced model; this class takes the original model geometry as a parameter and provides buffer data of instance attributes for each instance;

步骤四:创建InstancedMesh对象,将实例化几何体和实例化模型对象作为参数传递给InstancedMesh构造函数。Step 4: Create an InstancedMesh object and pass the instanced geometry and instanced model objects as parameters to the InstancedMesh constructor.

本发明的有益效果是:在进行3D实时渲染的过程中先后经过清漆、透光、体积和顺序无关的半透明混合步骤,并在顺序无关的半透明混合步骤中进行半透明混合深度测试,通过半透明混合深度测试后才能结束混合步骤,进而使得半透明物体能够达到深度混合的效果,且通过设置的性能优化步骤,在本地缓存WebAssembly模块和脚本,以便在初次访问后加快加载速度,ktx纹理压缩工作流程并贴图转ktx提升场景性能;GPU实例化在每次绘制调用时渲染相同的网格,将每个实例具有不同的参数以增加变化并减少外观上的重复,进而对3D设计系统进行性能优化。The beneficial effects of the present invention are as follows: in the process of 3D real-time rendering, varnish, light transmission, volume and order-independent translucent mixing steps are successively passed, and a translucent mixing depth test is performed in the order-independent translucent mixing step. The mixing step can be ended only after the translucent mixing depth test is passed, thereby enabling the translucent object to achieve a depth mixing effect, and through the set performance optimization steps, the WebAssembly modules and scripts are cached locally to speed up the loading speed after the first access, the ktx texture compression workflow and map conversion to ktx improve the scene performance; GPU instantiation renders the same mesh at each drawing call, and each instance has different parameters to increase changes and reduce repetition in appearance, thereby optimizing the performance of the 3D design system.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本发明流程示意图;Fig. 1 is a schematic diagram of the process of the present invention;

图2为本发明3D实时渲染步骤流程示意图;FIG2 is a schematic diagram of a 3D real-time rendering process of the present invention;

图3为本发明清漆步骤示意图;FIG3 is a schematic diagram of the varnishing step of the present invention;

图4为本发明清漆步骤计算式;FIG4 is a calculation formula for the varnish step of the present invention;

图5为本发明透光流程示意图;FIG5 is a schematic diagram of the light transmission process of the present invention;

图6为本发明体积步骤示意图;FIG6 is a schematic diagram of the volume steps of the present invention;

图7为本发明顺序无关的半透明混合步骤示意图;FIG. 7 is a schematic diagram of the sequence-independent semi-transparent mixing steps of the present invention;

图8为本发明半透明混合深度测试示意图;FIG8 is a schematic diagram of a semi-transparent mixed depth test according to the present invention;

图9为本发明数据处理示意图;FIG9 is a schematic diagram of data processing according to the present invention;

图10为本发明数据存储备份示意图。FIG. 10 is a schematic diagram of data storage backup according to the present invention.

具体实施方式Detailed ways

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

本发明实施例公开一种基于Realibox引擎的3D设计系统。The embodiment of the present invention discloses a 3D design system based on the Realibox engine.

根据附图1-10所示,包括以下步骤:As shown in Figures 1-10, the method comprises the following steps:

步骤一:3D实时渲染,标准效果采用基于物理的渲染,实现跨不同环境的逼真、无缝的渲染结果;Step 1: 3D real-time rendering, standard effects use physically based rendering to achieve realistic and seamless rendering results across different environments;

步骤二:性能优化,对渲染性能进行优化;Step 2: Performance optimization, optimize rendering performance;

步骤三:数据存储和备份,对渲染数据进行存储和备份。Step 3: Data storage and backup, store and back up the rendering data.

在进行3D实时渲染的过程中先后经过清漆、透光、体积和顺序无关的半透明混合步骤,并在顺序无关的半透明混合步骤中进行半透明混合深度测试,通过半透明混合深度测试后才能结束混合步骤,进而使得半透明物体能够达到深度混合的效果,且通过设置的性能优化步骤,在本地缓存WebAssembly模块和脚本,以便在初次访问后加快加载速度,ktx纹理压缩工作流程并贴图转ktx提升场景性能;GPU实例化在每次绘制调用时渲染相同的网格,将每个实例具有不同的参数以增加变化并减少外观上的重复,进而对3D设计系统进行性能优化。In the process of 3D real-time rendering, it goes through varnish, light transmission, volume and order-independent translucent mixing steps successively, and performs translucent mixing depth test in the order-independent translucent mixing step. The mixing step can be ended only after passing the translucent mixing depth test, so that the translucent objects can achieve the effect of depth mixing. In addition, through the set performance optimization steps, WebAssembly modules and scripts are cached locally to speed up loading after the first access. The ktx texture compression workflow and map conversion to ktx improve the scene performance; GPU instancing renders the same mesh at each drawing call, and each instance has different parameters to increase changes and reduce repetition in appearance, thereby optimizing the performance of the 3D design system.

进一步的,所述3D实时渲染包括:Furthermore, the 3D real-time rendering includes:

步骤一:清漆;Step 1: Varnish;

步骤二:透光;Step 2: Light transmission;

步骤三:体积;Step 3: Volume;

步骤四:顺序无关的半透明混合。Step 4: Order-independent translucent blending.

进一步的,所述清漆步骤具体为:Furthermore, the varnishing step is specifically as follows:

基于各向同性GGX分布和微平面BRDF粗糙度,对于清漆材质物体的表面分为两部分,其中一部分是ClearCoatLayer,另一部分是BaseLayer,一束光入射到表面,一部分光直接反射出去ClearCoat高光,且忽略这部分光的漫反射,另一部分进入BaseLayer,再分为漫反射与GGX高光反射出去。Based on the isotropic GGX distribution and microfacet BRDF roughness, the surface of the varnish material object is divided into two parts, one part is ClearCoatLayer and the other part is BaseLayer. When a beam of light is incident on the surface, part of the light is directly reflected as ClearCoat highlight, and the diffuse reflection of this part of the light is ignored. The other part enters BaseLayer and is divided into diffuse reflection and GGX highlight reflection.

进一步的,所述透光步骤具体为:Furthermore, the light transmission step is specifically as follows:

利用transmission将specular_btdf添加到核心BRDF。Add specular_btdf to the core BRDF using transmission.

优选的,所述体积步骤具体为:Preferably, the volume step is specifically:

各种对象的渲染以及场景中相应的自上而下切片,实线代表网格,灰色区域代表体积,薄壁材料应用于开放式和封闭式网格,虚线表示无限薄体积的假想边界,体积材质应用于闭合网格,从而产生折射的体积效果。Rendering of various objects and the corresponding top-down slice through the scene. Solid lines represent meshes, grey areas represent volumes, thin-walled materials are applied to open and closed meshes, dashed lines represent imaginary boundaries of infinitely thin volumes, and volumetric materials are applied to closed meshes, creating a volumetric effect of refraction.

特别公开的,所述顺序无关的半透明混合步骤具体为:Specifically disclosed, the order-independent semi-transparent mixing steps are:

over从后往前一层层叠加,而under则是从前往后一层层叠加;Over is stacked from back to front, while under is stacked from front to back.

从近到远设置有c-b-a三层There are three layers from near to far: c-b-a

over操作:先将ab叠加,再与c叠加;Over operation: first superimpose ab, then superimpose with c;

under操作:先将bc叠加,再与a叠加;Under operation: first superimpose bc, then superimpose with a;

从前往后逐层对半透明物体执行under操作,使所有要渲染的半透明物体都混合为一层,最后与底层的不透明物体执行over操作。The under operation is performed on the semi-transparent objects layer by layer from front to back, so that all the semi-transparent objects to be rendered are mixed into one layer, and finally the over operation is performed with the opaque objects at the bottom layer.

特别公开的,所述半透明混合深度测试步骤如下:Specifically disclosed, the semi-transparent mixed depth test steps are as follows:

步骤一、无序遍历所有物体执行深度测试,将最近的片元深度写入z-buffer;Step 1: Perform depth testing on all objects in an unordered manner and write the depth of the nearest fragment into the z-buffer.

步骤二、无序遍历半透明物体,比较片元深度与z-buffer的深度,若相同则将半透明片元颜色与color-buffer执行under,第一次执行时,直接写入color-buffer即可,同时将半透明片元透明度写入a-buffer,并标记片元的深度为一个特定值,代表此层剥离;Step 2: Traverse the semi-transparent objects in an unordered manner, compare the depth of the fragment with the depth of the z-buffer, and if they are the same, execute under the color-buffer with the color-buffer. When executing for the first time, just write it directly into the color-buffer. At the same time, write the transparency of the semi-transparent fragment into the a-buffer, and mark the depth of the fragment as a specific value, indicating that this layer is peeled off;

步骤三、同步骤一,无序遍历所有物体执行深度测试,将最近的片元深度写入z-buffer;Step 3: Same as step 1, traverse all objects in an unordered manner to perform depth testing, and write the depth of the nearest fragment into the z-buffer;

步骤四、无序遍历半透明物体,比较片元深度与z-buffer的深度,若相同,则将半透明片元颜色与color-buffer执行under,将混合后的颜色和透明度写入color-buffer和a-buffer,并标记片元的深度为特定值,代表此层剥离;Step 4: Traverse the semi-transparent objects in an unordered manner, compare the depth of the fragment with the depth of the z-buffer, if they are the same, perform under on the color-buffer and write the mixed color and transparency into the color-buffer and a-buffer, and mark the depth of the fragment as a specific value, indicating that this layer is peeled off;

步骤五、重复步骤三-步骤四,满足任一个以下条件即可终止;Step 5: Repeat Step 3 to Step 4, and terminate when any of the following conditions is met;

1、遍历半透明物体时,所有片元的深度都和z-buffer不相等,代表碰到不透明物体;1. When traversing a translucent object, the depth of all fragments is not equal to the z-buffer, which means that an opaque object is encountered;

2、由于每次under后,a-buffer里面的透明度都会变大且接近于1,检测a-buffer里面都大于阈值;2. Since the transparency in a-buffer increases and approaches 1 after each under, the detection in a-buffer is greater than the threshold;

3、重复固定的次数;3. Repeat a fixed number of times;

步骤六、将不透明与半透明合为的一层进行混合;遍历不透明物体执行深度测试,将最近的不透明物体颜色与当前的color-buffer执行over操作。Step 6: Blend the opaque and translucent layers; traverse the opaque objects to perform depth testing, and perform an over operation on the color of the nearest opaque object and the current color-buffer.

特别公开的,所述性能优化包括以下步骤:Particularly disclosed, the performance optimization comprises the following steps:

步骤一:在本地缓存WebAssembly模块和脚本,以便在初次访问后加快加载速度;Step 1: Cache WebAssembly modules and scripts locally to speed up loading after the first visit;

步骤二:ktx纹理压缩,ktx纹理压缩工作流程并贴图转ktx提升场景性能;Step 2: ktx texture compression, ktx texture compression workflow and map conversion to ktx to improve scene performance;

步骤三:模型实例化,GPU实例化在每次绘制调用时渲染相同的网格,将每个实例具有不同的参数以增加变化并减少外观上的重复。Step 3: Model Instancing, GPU instancing renders the same mesh on each draw call, with each instance having different parameters to increase variation and reduce repetition in appearance.

优选的,所述模型实例化包括以下步骤:Preferably, the model instantiation comprises the following steps:

步骤一:创建需要实例化的模型对象和实例数量;Step 1: Create the model object and instance quantity to be instantiated;

步骤二:创建实例化模型对象并将模型作为Geomery对象的属性添加到该实例化模型对象中;Step 2: Create an instantiated model object and add the model as a property of the Geomery object to the instantiated model object;

步骤三:使用InstancedBufferGeometry类来创建实例化模型的几何体;该类将原始模型几何体作为参数,并为每个实例提供实例属性的缓冲区数据;Step 3: Use the InstancedBufferGeometry class to create the geometry of the instanced model; this class takes the original model geometry as a parameter and provides buffer data of instance attributes for each instance;

步骤四:创建InstancedMesh对象,将实例化几何体和实例化模型对象作为参数传递给InstancedMesh构造函数。Step 4: Create an InstancedMesh object and pass the instanced geometry and instanced model objects as parameters to the InstancedMesh constructor.

在进行3D实时渲染的过程中先后经过清漆、透光、体积和顺序无关的半透明混合步骤,并在顺序无关的半透明混合步骤中进行半透明混合深度测试,通过半透明混合深度测试后才能结束混合步骤,进而使得半透明物体能够达到深度混合的效果,且通过设置的性能优化步骤,在本地缓存WebAssembly模块和脚本,以便在初次访问后加快加载速度,ktx纹理压缩工作流程并贴图转ktx提升场景性能;GPU实例化在每次绘制调用时渲染相同的网格,将每个实例具有不同的参数以增加变化并减少外观上的重复,进而对3D设计系统进行性能优化。In the process of 3D real-time rendering, it goes through varnish, light transmission, volume and order-independent translucent mixing steps successively, and performs translucent mixing depth test in the order-independent translucent mixing step. The mixing step can be ended only after passing the translucent mixing depth test, so that the translucent objects can achieve the effect of depth mixing. In addition, through the set performance optimization steps, WebAssembly modules and scripts are cached locally to speed up loading after the first access. The ktx texture compression workflow and map conversion to ktx improve the scene performance; GPU instancing renders the same mesh at each drawing call, and each instance has different parameters to increase changes and reduce repetition in appearance, thereby optimizing the performance of the 3D design system.

此外,应当理解,虽然本说明书按照实施方式加以描述,但并非每个实施方式仅包含一个独立的技术方案,说明书的这种叙述方式仅仅是为清楚起见,本领域技术人员应当将说明书作为一个整体,各实施例中的技术方案也可以经适当组合,形成本领域技术人员可以理解的其他实施方式。In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

Claims (9)

1.一种基于Realibox引擎的3D设计系统,其特征在于,包括以下步骤:1. A 3D design system based on Realibox engine, characterized by comprising the following steps: 步骤一:3D实时渲染,标准效果采用基于物理的渲染,实现跨不同环境的逼真、无缝的渲染结果;Step 1: 3D real-time rendering, standard effects use physically based rendering to achieve realistic and seamless rendering results across different environments; 步骤二:性能优化,对渲染性能进行优化;Step 2: Performance optimization, optimize rendering performance; 步骤三:数据存储和备份,对渲染数据进行存储和备份。Step 3: Data storage and backup, store and back up the rendering data. 2.根据权利要求1所述的一种基于Realibox引擎的3D设计系统,其特征在于,所述3D实时渲染包括:2. A 3D design system based on the Realibox engine according to claim 1, characterized in that the 3D real-time rendering comprises: 步骤一:清漆;Step 1: Varnish; 步骤二:透光;Step 2: Light transmission; 步骤三:体积;Step 3: Volume; 步骤四:顺序无关的半透明混合。Step 4: Order-independent translucent blending. 3.根据权利要求2所述的一种基于Realibox引擎的3D设计系统,其特征在于,所述清漆步骤具体为:3. A 3D design system based on Realibox engine according to claim 2, characterized in that the varnishing step is specifically: 基于各向同性GGX分布和微平面BRDF粗糙度,对于清漆材质物体的表面分为两部分,其中一部分是ClearCoatLayer,另一部分是BaseLayer,一束光入射到表面,一部分光直接反射出去ClearCoat高光,另一部分进入BaseLayer,再分为漫反射与GGX高光反射出去。Based on the isotropic GGX distribution and microfacet BRDF roughness, the surface of the varnish material object is divided into two parts, one is the ClearCoatLayer and the other is the BaseLayer. When a beam of light is incident on the surface, part of the light is directly reflected as the ClearCoat highlight, and the other part enters the BaseLayer and is divided into diffuse reflection and GGX highlight reflection. 4.根据权利要求2所述的一种基于Realibox引擎的3D设计系统,其特征在于,所述透光步骤具体为:4. A 3D design system based on the Realibox engine according to claim 2, characterized in that the light transmission step is specifically: 利用transmission将specular_btdf添加到核心BRDF。Add specular_btdf to the core BRDF using transmission. 5.根据权利要求2所述的一种基于Realibox引擎的3D设计系统,其特征在于,所述体积步骤具体为:5. A 3D design system based on Realibox engine according to claim 2, characterized in that the volume step is specifically: 各种对象的渲染以及场景中相应的自上而下切片,实线代表网格,灰色区域代表体积,薄壁材料应用于开放式和封闭式网格,虚线表示无限薄体积的假想边界,体积材质应用于闭合网格,从而产生折射的体积效果。Rendering of various objects and the corresponding top-down slice through the scene. Solid lines represent meshes, grey areas represent volumes, thin-walled materials are applied to open and closed meshes, dashed lines represent imaginary boundaries of infinitely thin volumes, and volumetric materials are applied to closed meshes, creating a volumetric effect of refraction. 6.根据权利要求2所述的一种基于Realibox引擎的3D设计系统,其特征在于,所述顺序无关的半透明混合步骤具体为:6. A 3D design system based on the Realibox engine according to claim 2, characterized in that the order-independent semi-transparent blending step is specifically: over从后往前一层层叠加,而under则是从前往后一层层叠加;Over is stacked from back to front, while under is stacked from front to back. 从近到远设置有c-b-a三层There are three layers from near to far: c-b-a over操作:先将ab叠加,再与c叠加;Over operation: first superimpose ab, then superimpose with c; under操作:先将bc叠加,再与a叠加;Under operation: first superimpose bc, then superimpose with a; 从前往后逐层对半透明物体执行under操作,使所有要渲染的半透明物体都混合为一层,最后与底层的不透明物体执行over操作。The under operation is performed on the semi-transparent objects layer by layer from front to back, so that all the semi-transparent objects to be rendered are mixed into one layer, and finally the over operation is performed with the opaque objects at the bottom layer. 7.根据权利要求6所述的一种基于Realibox引擎的3D设计系统,其特征在于,所述半透明混合深度测试步骤如下:7. A 3D design system based on the Realibox engine according to claim 6, characterized in that the semi-transparent mixed depth test step is as follows: 步骤一、无序遍历所有物体执行深度测试,将最近的片元深度写入z-buffer;Step 1: Perform depth testing on all objects in an unordered manner and write the depth of the nearest fragment into the z-buffer. 步骤二、无序遍历半透明物体,比较片元深度与z-buffer的深度,若相同则将半透明片元颜色与color-buffer执行under,第一次执行时,直接写入color-buffer即可,同时将半透明片元透明度写入a-buffer,并标记片元的深度为一个特定值,代表此层剥离;Step 2: Traverse the semi-transparent objects in an unordered manner, compare the depth of the fragment with the depth of the z-buffer, and if they are the same, execute under the color-buffer with the color-buffer. When executing for the first time, write directly into the color-buffer, write the transparency of the semi-transparent fragment into the a-buffer, and mark the depth of the fragment as a specific value, indicating that this layer is peeled off; 步骤三、同步骤一,无序遍历所有物体执行深度测试,将最近的片元深度写入z-buffer;Step 3: Same as step 1, traverse all objects in an unordered manner to perform depth testing, and write the depth of the nearest fragment into the z-buffer; 步骤四、无序遍历半透明物体,比较片元深度与z-buffer的深度,若相同,则将半透明片元颜色与color-buffer执行under,将混合后的颜色和透明度写入color-buffer和a-buffer,并标记片元的深度为特定值,代表此层剥离;Step 4: Traverse the semi-transparent objects in an unordered manner, compare the depth of the fragment with the depth of the z-buffer, if they are the same, perform under on the color-buffer and write the mixed color and transparency into the color-buffer and a-buffer, and mark the depth of the fragment as a specific value, indicating that this layer is peeled off; 步骤五、重复步骤三-步骤四,满足任一个以下条件即可终止;Step 5: Repeat Step 3 to Step 4, and terminate when any of the following conditions is met; 1、遍历半透明物体时,所有片元的深度都和z-buffer不相等,代表碰到不透明物体;1. When traversing a translucent object, the depth of all fragments is not equal to the z-buffer, which means that an opaque object is encountered; 2、由于每次under后,a-buffer里面的透明度都会变大且接近于1,检测a-buffer里面都大于阈值;2. Since the transparency in a-buffer increases and approaches 1 after each under, the detection in a-buffer is greater than the threshold; 3、重复固定的次数;3. Repeat a fixed number of times; 步骤六、将不透明与半透明合为的一层进行混合;遍历不透明物体执行深度测试,将最近的不透明物体颜色与当前的color-buffer执行over操作。Step 6: Blend the opaque and translucent layers; traverse the opaque objects to perform depth testing, and perform an over operation on the color of the nearest opaque object and the current color-buffer. 8.根据权利要求1所述的一种基于Realibox引擎的3D设计系统,其特征在于,所述性能优化包括以下步骤:8. The 3D design system based on the Realibox engine according to claim 1, wherein the performance optimization comprises the following steps: 步骤一:在本地缓存WebAssembly模块和脚本,以便在初次访问后加快加载速度;Step 1: Cache WebAssembly modules and scripts locally to speed up loading after the first visit; 步骤二:ktx纹理压缩,ktx纹理压缩工作流程并贴图转ktx提升场景性能;Step 2: ktx texture compression, ktx texture compression workflow and map conversion to ktx to improve scene performance; 步骤三:模型实例化,GPU实例化在每次绘制调用时渲染相同的网格,将每个实例具有不同的参数以增加变化并减少外观上的重复。Step 3: Model Instancing, GPU instancing renders the same mesh on each draw call, with each instance having different parameters to increase variation and reduce repetition in appearance. 9.根据权利要求8所述的一种基于Realibox引擎的3D设计系统,其特征在于,所述模型实例化包括以下步骤:9. A 3D design system based on the Realibox engine according to claim 8, characterized in that the model instantiation comprises the following steps: 步骤一:创建需要实例化的模型对象和实例数量;Step 1: Create the model object and instance quantity to be instantiated; 步骤二:创建实例化模型对象并将模型作为Geomery对象的属性添加到该实例化模型对象中;Step 2: Create an instantiated model object and add the model as a property of the Geomery object to the instantiated model object; 步骤三:使用InstancedBufferGeometry类来创建实例化模型的几何体;该类将原始模型几何体作为参数,并为每个实例提供实例属性的缓冲区数据;Step 3: Use the InstancedBufferGeometry class to create the geometry of the instanced model; this class takes the original model geometry as a parameter and provides buffer data of instance attributes for each instance; 步骤四:创建InstancedMesh对象,将实例化几何体和实例化模型对象作为参数传递给InstancedMesh构造函数。Step 4: Create an InstancedMesh object and pass the instanced geometry and instanced model objects as parameters to the InstancedMesh constructor.
CN202410184060.7A 2024-02-19 2024-02-19 Realibox engine-based 3D design system Active CN118096969B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410184060.7A CN118096969B (en) 2024-02-19 2024-02-19 Realibox engine-based 3D design system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410184060.7A CN118096969B (en) 2024-02-19 2024-02-19 Realibox engine-based 3D design system

Publications (2)

Publication Number Publication Date
CN118096969A true CN118096969A (en) 2024-05-28
CN118096969B CN118096969B (en) 2025-03-25

Family

ID=91146884

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410184060.7A Active CN118096969B (en) 2024-02-19 2024-02-19 Realibox engine-based 3D design system

Country Status (1)

Country Link
CN (1) CN118096969B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004294458A (en) * 2003-02-12 2004-10-21 Konica Minolta Holdings Inc Image information processing method, image information processing device, image output system, and computer program
CN108550178A (en) * 2018-04-19 2018-09-18 深浅度视觉科技(大连)有限公司 The virtual glasses texturing rendering intents of AR and system
CN109658487A (en) * 2018-11-01 2019-04-19 苏州蜗牛数字科技股份有限公司 A kind of real-time rendering device optimization method and system
CN110232664A (en) * 2019-06-13 2019-09-13 大连民族大学 A kind of mask restorative procedure of exorcising based on augmented reality
CN115423923A (en) * 2022-09-02 2022-12-02 珠海金山数字网络科技有限公司 Model rendering method and device
CN115496851A (en) * 2022-09-15 2022-12-20 长沙宏达威爱信息科技有限公司 Real-time renderer optimization method
CN115861522A (en) * 2023-03-02 2023-03-28 杭州片段网络科技有限公司 Image rendering method and device
CN117078824A (en) * 2023-08-30 2023-11-17 腾讯科技(深圳)有限公司 Parameter fitting method, device, equipment, storage medium and program product

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004294458A (en) * 2003-02-12 2004-10-21 Konica Minolta Holdings Inc Image information processing method, image information processing device, image output system, and computer program
CN108550178A (en) * 2018-04-19 2018-09-18 深浅度视觉科技(大连)有限公司 The virtual glasses texturing rendering intents of AR and system
CN109658487A (en) * 2018-11-01 2019-04-19 苏州蜗牛数字科技股份有限公司 A kind of real-time rendering device optimization method and system
CN110232664A (en) * 2019-06-13 2019-09-13 大连民族大学 A kind of mask restorative procedure of exorcising based on augmented reality
CN115423923A (en) * 2022-09-02 2022-12-02 珠海金山数字网络科技有限公司 Model rendering method and device
CN115496851A (en) * 2022-09-15 2022-12-20 长沙宏达威爱信息科技有限公司 Real-time renderer optimization method
CN115861522A (en) * 2023-03-02 2023-03-28 杭州片段网络科技有限公司 Image rendering method and device
CN117078824A (en) * 2023-08-30 2023-11-17 腾讯科技(深圳)有限公司 Parameter fitting method, device, equipment, storage medium and program product

Also Published As

Publication number Publication date
CN118096969B (en) 2025-03-25

Similar Documents

Publication Publication Date Title
Wylie et al. Tetrahedral projection using vertex shaders
US11295508B2 (en) Hardware-based techniques applicable for ray tracing for efficiently representing and processing an arbitrary bounding volume
AU2006236289B2 (en) Techniques and workflows for computer graphics animation system
US10607400B2 (en) Graphics processing systems using a vertex shader to render plural images
EP1594091B1 (en) System and method for providing an enhanced graphics pipeline
CN101458823B (en) Real-time lighting drawing method under virtual stage environment
US20210183129A1 (en) Graphics processing
US11756255B2 (en) Method for constructing and traversing accelerating structures
EP2329457A1 (en) Systems and methods for a ray tracing shader api
CN106469463A (en) A kind of rendering intent being mixed with GPU based on CPU
Mattausch et al. CHC+ RT: Coherent hierarchical culling for ray tracing
Vasilakis et al. A survey of multifragment rendering
CN107784622A (en) Graphic system and graphics processor
US20240062453A1 (en) Generation of tight world space bounding regions
US20240104824A1 (en) Accelerated bounding volume hierarchy (bvh) traversal for ray tracing
CN118096969A (en) A 3D design system based on Realibox engine
WO2021137207A2 (en) Real-time, software-based hybrid ray tracing for battery-powered computing devices
Schollmeyer et al. Order‐independent transparency for programmable deferred shading pipelines
Yuan et al. Diffcsg: Differentiable csg via rasterization
CN116468833A (en) Hair rendering speed increasing method, device, equipment and readable storage medium
Koa et al. ESLPV: enhanced subsurface light propagation volumes
Nair Using Raymarched shaders as environments in 3D video games
CN115690301A (en) Graphics processing system
Huang et al. Scalable programmable motion effects on GPUs
Yang et al. Data-based real-time petrochemical gas diffusion simulation approach on virtual reality

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