An unreal engine-based post-processing material acquisition method and use method

CN115731369BActive Publication Date: 2026-09-25WELLINK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211497145.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-24
Publication Date
2026-09-25
Estimated Expiration
2042-11-24

AI Technical Summary

Technical Problem

但虚幻引擎中的现有的后处理特效为二维效果,无法在三维空间定位后处理特效的位置和范围

Benefits of technology

[0014]本申请通过转换空间将场景中的物体的三维位置转化为二维向量,获得后处理材料,并将该后处理材料提供给后期处理效果使用,从而实现在三维空间定位后处理特效的位置和范围的效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115731369B_ABST
    Figure CN115731369B_ABST
Patent Text Reader

Abstract

The application discloses a post-processing material acquisition method and use method based on an Unreal Engine, wherein the post-processing material acquisition method based on the Unreal Engine comprises the following steps: acquiring a generation position, obtaining a vector according to a camera position and the generation position; converting the generation position according to the vector to obtain a screen space position; obtaining a start-end mask UV according to the generation position, the screen space position and the vector, and inputting the start-end mask UV into a scene display map as post-processing material. The application converts a three-dimensional position of an object in a scene into a two-dimensional vector through space conversion, obtains post-processing material, and provides the post-processing material for post-processing effects, so that the position and range of a three-dimensional space positioning post-processing special effect are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method for obtaining and using post-processed materials based on Unreal Engine. Background Technology

[0002] Unreal Engine's post-processing effects are designed for 2D screen effects. A method for post-processing in 3D space is achieved by creating a post-processing material and accessing a buffer of a custom stencil, which can be used in shaders to create masks on certain objects. However, existing post-processing effects in Unreal Engine are 2D and cannot be positioned or limited in 3D space. Summary of the Invention

[0003] The purpose of this application is to provide a method for obtaining and using post-processing materials based on Unreal Engine. By transforming space, the three-dimensional position of objects in the scene is converted into a two-dimensional vector to obtain post-processing materials, and these materials are provided for use in post-processing effects, thereby achieving the effect of locating the position and range of post-processing effects in three-dimensional space.

[0004] To achieve the above objectives, this application provides a post-processing material acquisition method based on Unreal Engine, comprising the following steps: obtaining the generation position, obtaining a vector based on the camera position and the generation position; transforming the generation position based on the vector to obtain the screen space position; obtaining the initial mask UV based on the generation position, the screen space position and the vector, and inputting the initial mask UV as post-processing material into the scene display texture.

[0005] As shown above, the vector is obtained by subtracting the camera position from the generated position.

[0006] As shown above, the vector is input to the camera relative position by a custom world position to screen 3D modeling conversion node, so that the generated position is converted from world space position to screen space position.

[0007] As described above, the sub-steps for obtaining the initial mask UV based on the generation position, screen space position, and vector are as follows: process the generation position to obtain the initial mask UV; input the initial mask UV to end A of the spherical mask node; input the screen space position to end B of the spherical mask node; input the vector to the radius port of the spherical mask node; after completing the input, the spherical mask node generates the output result based on the initial mask UV, screen space position, and vector, and uses the output result as the initial mask UV.

[0008] As shown above, the sub-steps for processing the generated position to obtain the initial mask UV are as follows: display the UV texture map coordinates of the generated position; remove all UV texture map coordinates other than those of the generated position, and use the remaining UV texture map coordinates of the generated position as the initial mask UV.

[0009] As shown above, the initial mask UV is input as a post-processing material into the screen post-processing material of the scene display texture.

[0010] This application also provides a method for using post-processing materials based on Unreal Engine, including the following steps: adding the post-processing effect volume of the post-processing box to the level of the world scene; setting the post-processing effect volume of the post-processing box to no border in the enabled volume box; adding the screen post-processing material of the scene display texture to the post-processing effect volume of the post-processing box; wherein, the screen post-processing material includes multiple post-processing materials, among which the multiple post-processing materials include: the aforementioned final mask UV; and using the post-processing effect volume of the post-processing box according to project requirements.

[0011] As mentioned above, the screen post-processing materials also include: material domain, blending mode, decal blending mode, shading model, double-sided, using material properties, projecting ray-traced shadows, and subsurface contours.

[0012] As mentioned above, the options for the material domain include at least: surface, delayed decal, lighting function, volume, post-processing, user interface, and virtual texture.

[0013] As mentioned above, the properties of the post-processing material include at least: blendable location, output transparency, and blendable priority.

[0014] This application transforms the three-dimensional position of objects in a scene into a two-dimensional vector by converting space, obtains post-processing material, and provides the post-processing material for use in post-processing effects, thereby achieving the effect of locating the position and range of post-processing effects in three-dimensional space. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings.

[0016] Figure 1 A flowchart illustrating one embodiment of a post-processing material acquisition method based on Unreal Engine;

[0017] Figure 2This is a flowchart of one embodiment of a method for using post-processed materials based on Unreal Engine. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] like Figure 1 As shown, this application provides a method for obtaining post-processing materials based on Unreal Engine, including the following steps:

[0020] S110: Obtain the generated position by generating a vector based on the camera position and the generated position.

[0021] Furthermore, the vector is obtained by subtracting the camera position from the generated position (In Position).

[0022] Specifically, the generated position is the location where the object is generated in world space. The camera position is the location of the camera in world space. The direction of the vector obtained by subtracting the camera position from the generated position (In Position) is the direction in which the viewpoint is looking towards the object.

[0023] S120: Transform the generated position according to the vector to obtain the screen space position.

[0024] Furthermore, by customizing the world position to screen 3D modeling transformation node, the vector is input to the camera relative position, so that the generated position is transformed from the world space position to the screen space position.

[0025] Specifically, the existing Manual World to ScreenUVs Transform node is used to input vectors to the Camera Relative Position, thus converting the generated position from the initial world space position to the screen space position. The screen space position refers to the object's location within screen space.

[0026] Furthermore, as an example, the method for transforming the generated position based on the vector to obtain the screen space position is as follows: subtract the camera position from the world position to obtain the camera relative position. Multiply the value of the camera relative position by the X-axis value and Y-axis value of the camera world position respectively. After multiplication, add the two values ​​obtained by multiplication. Then, divide the sum by the Z-axis value of the camera world position and multiply by 1 / 2tan (field angle) to obtain the value. Compensate the non-square buffer with the value obtained after division. After compensation, divide by the X-axis value and Y-axis value of the camera world position to find the perspective projection and obtain the final value. Finally, decompress the final value to 0-1. After decompression, the screen space position can be obtained.

[0027] S130: Obtain the initial mask UV based on the generation location, screen space location, and vector, and input the initial mask UV as post-processing material into the scene display texture.

[0028] Specifically, in this application, UV refers to the UV texture map coordinates of 3D modeling. As an example, UV consists of an X-axis and a Y-axis, with the (0,0) point of UV at the upper left corner and the lower right corner at (1,1). Black is represented by both X and Y coordinates less than or equal to 0; red is represented by a Y coordinate of 0; green is represented by an X coordinate of 0; and yellow is represented by both X and Y coordinates greater than 0.

[0029] Furthermore, the sub-steps for obtaining the initial mask UVs based on the generation position, screen space position, and vector are as follows:

[0030] S1301: Process the generated position to obtain the initial mask UV.

[0031] Further processing of the generated location to obtain the initial mask UVs involves the following sub-steps:

[0032] S13011: Displays the UV texture map coordinates of the generated location.

[0033] S13012: Remove all UV texture map coordinates except those of the generated location, and use the remaining UV texture map coordinates of the generated location as the initial mask UV.

[0034] Specifically, the initial mask UV is a circular mask.

[0035] S1302: Input the initial mask UV to the A end of the spherical mask node.

[0036] Specifically, the initial mask UV is input through the A end of the existing SphereMask node.

[0037] S1303: Input the screen space position to the B end of the spherical mask node.

[0038] Specifically, the screen space location is input via the B-end of the existing SphereMask node.

[0039] S1304: Input the vector to the radius port of the spherical mask node.

[0040] Specifically, the input vector is obtained through the Radius port of the existing SphereMask node. The size of the mask is adjusted by the length of the vector.

[0041] S1305: After the input is completed, the spherical mask node generates the output result based on the initial mask UV, screen space position and vector, and uses the output result as the final initial mask UV.

[0042] Specifically, the initial mask UV is a circular mask.

[0043] Furthermore, the initial mask UV is input as a post-processing material into the screen post-processing material of the scene display texture.

[0044] Currently, the post-processing effects in Unreal Engine are two-dimensional. This application transforms the space, converting the three-dimensional positions of objects in the scene into two-dimensional vectors, to obtain the initial mask UVs that can locate the position and range of post-processing effects in three-dimensional space. The initial mask UVs are then input as post-processing materials into the screen post-processing material of the scene display texture, providing them for use in post-processing effects, enabling special screen effects such as distortion, hue separation, and post-blending.

[0045] like Figure 2 As shown, this application provides a method for using post-processed materials based on Unreal Engine, including the following steps:

[0046] S210: Adds the post-processing effect volume of the post-processing box to the level of the world scene.

[0047] Specifically, post-processing effect volumes (PostProcessVolumes) are added to the levels of the world scene. The PostProcessVolumes are existing ones.

[0048] S220: In the Enable Volume box, set the post-processing effect volume of the post-processing box to No Borders.

[0049] S230: Add the screen post-processing material of the scene display texture to the post-processing effect volume of the post-processing box; wherein, the screen post-processing material includes multiple post-processing materials, including: the initial mask UV obtained according to the above-mentioned post-processing material acquisition method based on Unreal Engine.

[0050] S240: Use the post-processing effect volume of the post-processing box according to project requirements.

[0051] Specifically, the post-processing effects volume of the post-processing box is used according to the project requirements, such as adding screen post-processing custom effects such as distortion, warping, and hue separation.

[0052] Furthermore, the screen post-processing materials also include: material domains, blending modes, decal blending modes, shading models, double-sided, using material properties, projecting ray-traced shadows, and subsurface contours.

[0053] Furthermore, the options for the material domain include at least: surface, delayed decal, lighting function, volume, post-processing, user interface, and virtual texture.

[0054] Specifically, the Material Domain specifies how to use a particular material through its options. Some material usage (e.g., decals) requires additional instructions for the rendering engine to consider. The Material Domain includes the following options:

[0055] Surface: Use this option to define the material as something that will be used on the surface of an object, such as metal, plastic, skin, or any physical surface.

[0056] Deferred Decal: Use this option to create decal materials.

[0057] Light Function: This option should be used when creating materials that incorporate a light function.

[0058] Volume: This option is used when describing the material's properties as a 3D volume.

[0059] Post Process: Use this option to set if the material will be used as a post-processing material.

[0060] User Interface: Use this option to set the material when it is used for UMG or Slate user interfaces.

[0061] Virtual Texture: Use this option to create runtime virtual textures.

[0062] Furthermore, the Blend Mode describes how the output of the current material is blended with the already drawn content in the background. It controls how Unreal Engine combines the material (source color) with the material (destination color) already present in the framebuffer during rendering. The Blend Mode options include the following:

[0063] (1) BLEND_Opaque final color = source color. This means the material will be drawn on the background. This blending mode is compatible with lighting.

[0064] (2) BLEND_Masked final color = if OpacityMask > OpacityMaskClipValue, then it is the source color; otherwise, the pixel will be discarded. This blending mode is compatible with lighting.

[0065] (3) BLEND_Translucent Final color = Source color opacity + Destination color (1 - opacity). This blending mode is not compatible with dynamic lighting.

[0066] (4) BLEND_Additive Final color = source color + destination color. This blending mode is not compatible with dynamic lighting.

[0067] (5) BLEND_Modulate Final color = Source color x Target color. This blending mode is not compatible with dynamic lighting or fog unless the material is a decal material.

[0068] Furthermore, the Decal Blend Mode defines the blend mode, which is used when the Material Domain property is set to Deferred Decal and cannot be changed until the Material Domain is set accordingly. The Decal Blend Mode includes different blend modes than those available on the surface. The Decal Blend Mode includes the following modes:

[0069] (1) The Translucent mode includes: BaseColor, Metallic, Specular, Roughness, Emissive Color, Opacity, and Normal. Use the Translucent mode to blend in completely independent materials, such as a wavy puddle surrounded by a muddy structure based on a normal map.

[0070] (2) The Stain mode includes: Base Color and Opacity. It is suitable for decals that only change color, such as dry spray paint on walls.

[0071] (3) Normal mode includes: blended normal and opacity. Suitable for adding cracks to a surface.

[0072] (4) The Emissive mode includes a blend of Emissive and Opacity channels. It enables objects that are not normally luminous to emit light.

[0073] DBuffer Translucent Color, Normal, Roughness: These can also be placed in DBuffer for baking lighting.

[0074] (5) DBuffer Translucent Color mode: Put into DBuffer for baking lighting.

[0075] (6) DBuffer Translucent Color, Normal Mode: Put into DBuffer for baking lighting.

[0076] (7) DBuffer Translucent Color, Roughness Mode: Put into DBuffer for baking lighting.

[0077] (8) DBuffer Translucent Normal mode: Put into DBuffer for baking lighting.

[0078] (9) DBuffer Translucent Normal, Roughness mode: Put into DBuffer for baking lighting.

[0079] (10) DBuffer Translucent Roughness mode: Put into DBuffer for baking lighting.

[0080] (11) Volumetric Distance Function (experimental) mode: Outputs a directed distance based on the LightVector in opacity. No shadows are cast, but shadows are received. Furthermore, no per-pixel normals or quality settings are applied.

[0081] (12) AlphaComposite (Premultiplied Alpha) mode: Mixes the material with the existing scene colors. The texture colors are premultiplied with the transparency.

[0082] (13) Ambient Occlusion mode: Apply ambient occlusion to decals to simulate self-shadowing that occurs in surface gaps.

[0083] Furthermore, the shading model determines how to combine input materials (such as emissivity, diffuse, specular, and normal) to form the final color. For example:

[0084] (1) Unlit: The material is defined only by the Emissive and Opacity inputs and does not respond to lighting.

[0085] (2) Default Lighting: The default shading model, which is suitable for most solid objects.

[0086] (3) Subsurface: Used for subsurface scattering materials, such as wax and ice. Activate the Subsurface Color input.

[0087] (4) Preintegrated Skin: Used for materials that resemble human skin. Activate Subsurface Color input.

[0088] (5) Clear Coat: Used for materials with a semi-transparent coating, such as car paint or varnish. Activate Clear Coat and Clear Coat Roughness inputs.

[0089] (6) Subsurface Profile: Used for materials that resemble human skin. Subsurface profiles are required for proper use.

[0090] (7) Two-Sided Foliage: Uses accurate lighting and light transmission through surfaces (such as leaves on a tree) to create realistic-looking plant materials.

[0091] (8) Hair: Used to create realistic hair textures, which can precisely illuminate hair strands and handle highlights.

[0092] (9) Cloth: The material used to make realistic fabrics and their surface velvet.

[0093] (10) Eye: A material used to recreate the natural appearance of human eyes.

[0094] (11) Single Layer Water.

[0095] (12) Thin Translucent: A material used to create glass based on physical principles, such as colored or tinted glass. It can effectively handle white highlights from light sources and colored background objects.

[0096] (13) From Material Expression: Used to process multiple shaded models in a single material.

[0097] Specifically, Two-Sided: The normals are flipped to the back side, and lighting is calculated for both the front and back sides simultaneously. This is typically used for plants to avoid doubling the polygon count. Two-Sided cannot be used properly for static lighting because the mesh still uses only a single UV set for light mapping. Therefore, two-Sided materials using static lighting will have identical shadows on both sides.

[0098] Use Material Attributes: This checkbox will compress the Material Master node into a single input labeled "Material Attributes". This attribute is useful when you need to mix multiple materials using layered materials or when defining multiple material types using the Make Material Attributes expression node.

[0099] Cast Ray Traced Shadows: After enabling ray tracing in Project Settings, selecting this checkbox will allow you to use ray-traced shadows together with this material.

[0100] Subsurface Profile: Used to change the subsurface profile used in a material.

[0101] Furthermore, the properties of post-processed materials include at least: blendable location, output transparency, and blendable priority.

[0102] Specifically, Blendable Location: If the current material is intended for post-processing, the blendable location controls whether the material is calculated before or after tone mapping.

[0103] Output Alpha: If enabled, blendable objects will output transparency.

[0104] Blendable Priority: When multiple nodes appear simultaneously, this parameter determines the priority of the nodes and whether they will be merged. It is only used when the material domain is set to PostProcess.

[0105] Is Blendable: Allows blendability to be disabled. Only used when the Material Domain is set to Post Process.

[0106] Furthermore, advanced properties of post-processed materials include at least: enabling mold testing, mold comparison, and mold reference values.

[0107] Specifically, enabling stencil testing selectively performs material post-processing only on pixels that pass the custom depth / stencil buffer stencil test. Pixels that fail the stencil test will be filled with the previous material post-processing output or scene colors.

[0108] Stencil Compare: Use the drop-down menu to compare stencil tests.

[0109] Stencil Ref Value: Used to set the stencil reference value.

[0110] This application transforms the three-dimensional position of objects in a scene into a two-dimensional vector by converting space, obtains post-processing material, and provides the post-processing material for use in post-processing effects, thereby achieving the effect of locating the position and range of post-processing effects in three-dimensional space.

[0111] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the scope of protection of this application is intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application. Obviously, those skilled in the art can make various alterations and variations to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of protection of this application and its equivalents, this application also intends to include these modifications and variations.

Claims

1. A method for acquiring post-processing materials based on Unreal Engine, characterized in that, Includes the following steps: Obtain the generated position, and then obtain a vector based on the camera position and the generated position; The generated position is transformed based on the vector to obtain the screen space position; The initial mask UV is obtained based on the generation location, screen space location, and vector, and the initial mask UV is input into the scene display texture as a post-processing material. The sub-step of obtaining the initial mask UV based on the generation position, screen space position, and vector is as follows: process the generation position to obtain the initial mask UV; input the initial mask UV to end A of the spherical mask node; input the screen space position to end B of the spherical mask node; input the vector to the radius port of the spherical mask node; after completing the input, the spherical mask node generates the output result based on the initial mask UV, screen space position, and vector, and uses the output result as the initial mask UV. The sub-steps for processing the generated position to obtain the initial mask UV are as follows: display the UV texture map coordinates of the generated position; remove all UV texture map coordinates other than those of the generated position, and use the remaining UV texture map coordinates of the generated position as the initial mask UV.

2. The method for obtaining post-processing materials based on Unreal Engine according to claim 1, characterized in that, The vector is obtained by subtracting the camera position from the generated position.

3. The post-processing material acquisition method based on Unreal Engine according to claim 2, characterized in that, By using a custom world-to-screen 3D modeling transformation node, the vector is input to the camera's relative position, thus converting the generated position from world space position to screen space position.

4. The method for obtaining post-processing materials based on Unreal Engine according to claim 1, characterized in that, Input the initial mask UV as a post-processing material into the screen post-processing material of the scene display texture.

5. A method for using post-processed materials based on Unreal Engine, characterized in that, Includes the following steps: Add the post-processing effect volume of the post-processing box to the level of the world scene; In the Enable Volume box, set the post-processing effect volume of the post-processing box to No Borders; The screen post-processing material of the scene display texture is added to the post-processing effect volume of the post-processing box; wherein, the screen post-processing material includes multiple post-processing materials, and the multiple post-processing materials include: the initial mask UV obtained by the post-processing material acquisition method based on Unreal Engine according to any one of claims 1-4; The post-processing effect volume of the post-processing box is used according to project requirements.

6. The method for using post-processed materials based on Unreal Engine according to claim 5, characterized in that, Post-processing materials for the screen also include: material domains, blending modes, decal blending modes, shading models, double-sided, using material properties, projecting ray-traced shadows, and subsurface contours.

7. The method for using post-processed materials based on Unreal Engine according to claim 6, characterized in that, The options for the Material domain include at least: surface, delayed decal, lighting function, volume, post-processing, user interface, and virtual texture.

8. The method for using post-processed materials based on Unreal Engine according to claim 7, characterized in that, The properties of post-processed materials should include at least: blendable location, output transparency, and blendable priority.

Citation Information

Patent Citations

  • Hint-based streaming of auxiliary content assets for an interactive environment

    CN102113003A

  • Shadow rendering method and device, terminal and storage medium

    CN109993823A