Object rendering method and device, computing equipment, storage medium and program product
By obtaining the layout position of the object to be rendered and the associated information of the associated special effect objects and generating rendering information, the problems of high performance overhead and poor rendering effect in 3D rendering technology are solved, and the rendering efficiency and effect are improved.
Patent Information
- Application Number
- CN202411161002.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-12-06
AI Technical Summary
In 3D rendering technology, in order to achieve high-quality vivid visual effects, the rendering process becomes complicated, resulting in increased performance overhead and reduced overall system efficiency. Especially when processing objects to be rendered and associated special effects objects, it is difficult to control the number and effect of particles. , resulting in the rendering effect not vivid and natural enough.
By obtaining the layout position of the object to be rendered in the target scene, determining its rendering information, and generating rendering information of the associated special effect object based on the associated special effect object, and based on this information, rendering the object to be rendered and the associated special effect in the target scene based on this information Objects, improve rendering efficiency and reduce performance overhead.
It improves the rendering information generation efficiency of associated special effects objects, reduces performance overhead, improves the rendering efficiency of objects to be rendered and associated special effects objects, and achieves a more vivid and natural visual effect.
Smart Images

Figure CN119091023A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of image rendering technology, and more particularly to an object rendering method, apparatus, computing device, storage medium, and program product. Background Art
[0002] 3D rendering technology can be used to create realistic scenes, characters and special effects, thus giving people a more vivid, realistic and rich visual experience. 3D rendering technology can be applied to all aspects of production and life. For example, in game development, high-quality 3D rendering technology can greatly increase the player's sense of immersion and give players a better gaming experience; in advertising, 3D rendering technology can create a virtual model of the product, showing the product features in a multi-angle and all-round way, so that consumers can understand the product more intuitively and enhance the appeal of advertising.
[0003] However, in the process of implementing 3D rendering technology, more vivid and realistic visual effects often mean more complex rendering processes, which leads to greater performance overhead and reduces the overall efficiency of the system. Therefore, a rendering method with high rendering quality and low performance overhead is urgently needed. Summary of the invention
[0004] In view of this, an embodiment of the present specification provides an object rendering method. One or more embodiments of the present specification also relate to an object rendering device, a computing device, a computer-readable storage medium and a computer program product to solve the technical defects existing in the prior art.
[0005] According to a first aspect of an embodiment of this specification, there is provided an object rendering method, including:
[0006] Get the first layout position of the object to be rendered in the target scene;
[0007] Determine first rendering information of the object to be rendered according to the first layout position, and determine second rendering information of the associated special effect object according to association information between the object to be rendered and the associated special effect object, wherein the associated special effect object is an object surrounding the object to be rendered;
[0008] Based on the first rendering information and the second rendering information, the object to be rendered and the associated special effect object are rendered in the target scene.
[0009] According to a second aspect of an embodiment of this specification, there is provided an object rendering device, including:
[0010] An acquisition module is configured to acquire a first layout position of the object to be rendered in the target scene;
[0011] A determination module is configured to determine first rendering information of the object to be rendered according to the first layout position, and determine second rendering information of the associated special effect object according to association information between the object to be rendered and the associated special effect object, wherein the associated special effect object is an object surrounding the object to be rendered;
[0012] The rendering module is configured to render the to-be-rendered object and the associated special effect object in the target scene based on the first rendering information and the second rendering information.
[0013] According to a third aspect of an embodiment of this specification, a computing device is provided, including:
[0014] Memory and processor;
[0015] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the above-mentioned object rendering method are implemented.
[0016] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned object rendering method are implemented.
[0017] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instruction, which implements the steps of the above-mentioned object rendering method when executed by a processor.
[0018] An embodiment of the present specification implements obtaining a first layout position of an object to be rendered in a target scene; determining first rendering information of the object to be rendered based on the first layout position, and determining second rendering information of the associated special effect object based on association information between the object to be rendered and the associated special effect object, wherein the associated special effect object is an object surrounding the object to be rendered; and rendering the object to be rendered and the associated special effect object in the target scene based on the first rendering information and the second rendering information.
[0019] In this way, the first rendering information of the object to be rendered is determined through the first layout position, and the second rendering information of the associated special effect object is determined based on the association information between the object to be rendered and the associated special effect object. This can improve the generation efficiency of the second rendering information of the associated special effect object and reduce the performance overhead brought by determining the second rendering information, thereby improving the rendering efficiency of the object to be rendered and the associated special effect object. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a flowchart of an object rendering method provided by an embodiment of this specification;
[0021] Figure 2is a processing flow chart of an object rendering method provided by an embodiment of this specification;
[0022] Figure 3 It is a schematic diagram of the rendering effect of an object to be rendered in an object rendering method provided by an embodiment of this specification;
[0023] Figure 4 It is a schematic diagram of interlaced performance of associated special effect objects in an object rendering method provided by an embodiment of this specification;
[0024] Figure 5 It is a schematic diagram of deformation performance of an associated special effect object of an object rendering method provided by an embodiment of this specification;
[0025] Figure 6 It is a schematic diagram of illumination performance of an object to be rendered in an object rendering method provided by an embodiment of this specification;
[0026] Figure 7 is a structural diagram of an object rendering device provided by an embodiment of this specification;
[0027] Figure 8 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0028] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0029] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0030] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0031] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0032] First, the terms involved in one or more embodiments of this specification are explained.
[0033] GPU Instancing: GPU Instancing is a technology that uses the characteristics of GPU (graphics processing unit) to efficiently render a large number of similar objects or particles.
[0034] Alpha Cl ipping: It is a commonly used technique in graphics rendering, mainly used to process images or geometries with transparency information.
[0035] Dither: Reduces color banding by introducing small color variations between pixels, making the image appear smoother and more natural.
[0036] TAA (Temporal Anti-Aliasing): is a technique used to improve the quality of rendered images and can be used to deal with aliasing problems. It combines information from the current frame and previous frames to smooth edges, thereby reducing or eliminating aliasing.
[0037] Shader: A program that runs on the GPU and is used to control the color, texture, and other properties of pixels or vertices during the rendering process.
[0038] LOD (Level of Detail): LOD technology can prepare multiple models of different detail levels for the same object.
[0039] Animation state machine: a graphical tool used to describe, manage, and control the animations played by characters or objects in the game in different situations and the switching logic between them.
[0040] 3D rendering technology can be used to create realistic scenes, characters and special effects, thus giving people a more vivid, realistic and rich visual experience. 3D rendering technology can be applied to all aspects of production and life. For example, in game development, high-quality 3D rendering technology can greatly increase the player's sense of immersion and give players a better gaming experience; in advertising, 3D rendering technology can create a virtual model of the product, showing the product features in a multi-angle and all-round way, so that consumers can understand the product more intuitively and enhance the appeal of advertising.
[0041] However, in the process of implementing 3D rendering technology, more vivid and realistic visual effects often mean more complex rendering processes, which leads to greater performance overhead and reduces the overall efficiency of the system. In addition, in the process of rendering objects with special effects, the particle system will also cause a large rendering overhead, and it is difficult to control the number of particles and the performance of particle effects according to different requirements in the rendering process, resulting in the rendered visual effects not being vivid and natural enough.
[0042] Based on this, an embodiment of the present specification provides an object rendering method, which obtains a first layout position of an object to be rendered in a target scene; determines first rendering information of the object to be rendered based on the first layout position, and determines second rendering information of the associated special effect object based on association information between the object to be rendered and the associated special effect object, wherein the associated special effect object is an object surrounding the object to be rendered; based on the first rendering information and the second rendering information, renders the object to be rendered and the associated special effect object in the target scene.
[0043] In this way, the first rendering information of the object to be rendered is determined through the first layout position, and the second rendering information of the associated special effect object is determined based on the association information between the object to be rendered and the associated special effect object. This can improve the generation efficiency of the second rendering information of the associated special effect object and reduce the performance overhead brought by determining the second rendering information, thereby improving the rendering efficiency of the object to be rendered and the associated special effect object.
[0044] In this specification, an object rendering method is provided. This specification also relates to an object rendering apparatus, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.
[0045] See also Figure 1 , Figure 1 A flowchart of an object rendering method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.
[0046] Step 102: Obtain a first layout position of the object to be rendered in the target scene.
[0047] In actual applications, in the process of realizing the rendering effect for the object to be rendered, the first layout position of the object to be rendered in the target scene may be obtained first.
[0048] Specifically, the object to be rendered can be understood as the main object rendered in the target scene. Exemplarily, the object to be rendered can be a tornado body. The target scene can be understood as a digital virtual scene obtained by computer modeling, and the virtual scene can be set and constructed according to the needs of the designer.
[0049] In actual applications, a virtual scene may include multiple scenes, and the scene elements and layout information in each virtual scene may be different.
[0050] Specifically, the target scene is a scene containing the object to be rendered, that is, the object to be rendered needs to be rendered and displayed in the target scene. The first layout position can be understood as the layout position of the object to be rendered in the target scene, which is used to represent the position information of the object to be rendered in the target scene.
[0051] Optionally, the first layout position can be obtained through preset layout information corresponding to the target scene, or can be obtained through real-time configuration according to the needs of designers.
[0052] It should be noted that the first layout position can indicate the approximate position of the object to be rendered in the target scene, and the first layout position can be point coordinates (such as center point coordinates), or area coordinates (such as coordinates of an area box), and so on.
[0053] Optionally, the object to be rendered can be obtained by modeling, or by importing a pre-built object model.
[0054] Step 104: determining first rendering information of the object to be rendered according to the first layout position, and determining second rendering information of the associated special effect object according to association information between the object to be rendered and the associated special effect object, wherein the associated special effect object is an object surrounding the object to be rendered.
[0055] In actual applications, when the first layout position is obtained, the first rendering information of the object to be rendered can be determined according to the first layout position, and the second rendering information of the associated special effect object can be determined according to the association information between the object to be rendered and the associated special effect object. In this way, the object to be rendered and the associated special effect object can be rendered and displayed in the target scene based on the first rendering information and the second rendering information, thereby realizing the visual effect display of the object.
[0056] Specifically, the first rendering information can be understood as information used to render the object to be rendered in the target scene, and may include lighting information, transparency information, posture information, material information, etc. The associated special effect object can be understood as an object surrounding the object to be rendered, that is, a special effect object associated with the object to be rendered. The associated special effect object is used to constitute the visual effect of the object to be rendered, thereby making the object to be rendered more vivid and realistic.
[0057] For example, when the object to be rendered is a tornado body, the associated special effect object can be a particle in a particle system, and the particles can be emitted to the surrounding of the tornado body by a particle emitter and modeled by a patch. Through the particles, the gravel, sand, fog carried by the tornado, and the plants and vehicles involved in the tornado can be simulated, thereby achieving a more vivid and realistic tornado effect.
[0058] Specifically, the association information may represent the associated part between the object to be rendered and the associated special effect object, the association information may indicate the associated special effect object associated with the object to be rendered, and may indicate the position, quantity, and other information of the associated special effect object. The second rendering information may be understood as information used to render the associated special effect object in the target scene, and may include lighting information, transparency information, posture information, material information, and the like.
[0059] In an optional embodiment of the present specification, determining first rendering information of the object to be rendered according to the first layout position may include the following steps:
[0060] Determine first target vertex coordinates and environment information of the object to be rendered according to the first layout position;
[0061] First rendering information of the object to be rendered is generated based on the first target vertex coordinates and the environment information.
[0062] Specifically, the first target vertex coordinates can be understood as vertex coordinates corresponding to each vertex of the model of the object to be rendered. The environmental information may include scene elements located in front of and behind the object to be rendered, light source attribute information, and the like.
[0063] In practical applications, the model of the object to be rendered can be placed at the first layout position according to the first layout position, thereby obtaining vertex coordinates corresponding to each vertex of the model of the object to be rendered and environment information of the object to be rendered at the first layout position.
[0064] By applying this embodiment, by determining the first target vertex coordinates and environmental information of the object to be rendered according to the first layout position, it is possible to generate the first rendering information of the object to be rendered based on the first target vertex coordinates and environmental information when the layout position of the object to be rendered in the target scene is determined, thereby realizing the rendering of the object to be rendered.
[0065] In actual implementation, the object to be rendered may be composed of multiple layers. For example, when the object to be rendered is a tornado body, the object to be rendered may be composed of multiple stacked geometric models of the same type but with different size information.
[0066] According to an optional embodiment of the present specification, multiple models constituting the object to be rendered may be imported into the engine according to the number of models constituting the object to be rendered, thereby generating first rendering information of the object to be rendered based on the imported multiple models.
[0067] It should be noted that in the process of importing multiple models into the engine, each imported model requires data transmission between hardware. Therefore, importing multiple models requires multiple data transmissions, which increases the data transmission batches and brings greater performance overhead.
[0068] Based on this, according to another optional embodiment of the present specification, before determining the first rendering information of the object to be rendered according to the first layout position, the following steps may also be included:
[0069] A graphics generation interface is called to generate a plurality of target objects, wherein the plurality of target objects are used to form an object to be rendered, and the size information of the plurality of target objects is different.
[0070] Specifically, the graphics generation interface can be understood as an interface for generating geometric models, and specifically can be an interface provided by GPUI nstancing. The graphics generation interface can generate a preset number of geometric models with the same material and shape but different size information through a single call, that is, only one batch is needed to generate multiple target objects. The target object can be understood as an object that constitutes the object to be rendered, that is, a geometric model. The target object can include multiple, each target object has the same geometric type, but different size information.
[0071] For example, when the geometric body is a cube, the size information may specifically include the side length; when the geometric body is a cylinder, the size information may specifically include the radius and / or height.
[0072] In actual applications, the graphics generation interface can be called to generate multiple target objects with the same material and shape but different size information through one call; thus, an object to be rendered is composed based on the multiple target objects.
[0073] By applying this embodiment, a plurality of target objects for constituting an object to be rendered can be generated in one batch by calling a graphics generation interface, thereby reducing data transmission batches and lowering the performance overhead caused by multi-layer rendering.
[0074] Accordingly, determining the target vertex coordinates and environment information of the object to be rendered according to the first layout position may include:
[0075] Combining a plurality of target objects at a first layout position to obtain an object to be rendered and a first target vertex coordinate;
[0076] According to the first layout position, environmental information is determined.
[0077] Optionally, combining multiple target objects at the first layout position may include: arranging each target object from bottom to top or from top to bottom at the first layout position according to size information of each target object; and may also include: stacking each target object at the first layout position by editing methods such as dragging and dropping according to size information of each target object.
[0078] Optionally, determining the environment information according to the first layout position may include: determining background object information of the background object of the object to be rendered according to the first layout position; and may also include: determining direction information of the light source in the target scene according to the first layout position.
[0079] By applying this embodiment, by combining multiple target objects at a first layout position, the object to be rendered and the first target vertex coordinates are obtained; according to the first layout position, the environmental information is determined, and the first rendering information of the object to be rendered can be generated based on the first target vertex coordinates and the environmental information, thereby improving the accuracy and generation efficiency of the first rendering information.
[0080] In an optional embodiment of the present specification, combining multiple target objects at a first layout position to obtain the object to be rendered and the first target vertex coordinates may include the following steps:
[0081] Arrange multiple target objects vertically at the layout position according to the size information of each target object, and obtain the arrangement order and initial vertex coordinates of each target object;
[0082] According to the arrangement order and the preset offset direction, the vertex offset of each target object is determined in turn;
[0083] Based on the vertex offset, the initial vertex coordinates of each target object are offset to obtain the object to be rendered and the first target vertex coordinates.
[0084] Specifically, the arrangement order may represent the arrangement position of each target object in the vertical arrangement result. The arrangement order may be from bottom to top or from top to bottom, which may be determined according to the requirements in actual applications.
[0085] In actual applications, each target object may correspond to an instance ID, and the arrangement order of each target object may be recorded through the instance ID, so as to obtain at which layer of the multi-layer structure of the object to be rendered each target object is located.
[0086] It should be noted that, since the object to be rendered is composed of a plurality of target objects, the vertex coordinates of each target object can be understood as the vertex coordinates of the object to be rendered.
[0087] Specifically, the initial vertex coordinates can be understood as the initial vertex coordinates of each target object after multiple target objects are arranged vertically at the layout position according to the size information of each target object. The initial vertex coordinates can be obtained according to the scene coordinate system in the target scene, or according to the grid corresponding to the object to be rendered.
[0088] Specifically, the preset offset direction may be understood as the vertex offset direction corresponding to the vertex of each target object, and may specifically be a direction perpendicular to the plane where the vertex is located, that is, the direction of the plane normal of the plane where the vertex is located.
[0089] In practical applications, the vertex offsets of the vertices of each target object may be calculated layer by layer according to the arrangement order and the preset offset direction, so as to achieve vertex offset of each target object according to the vertex offsets.
[0090] It should be noted that the vertex offsets corresponding to different target objects may be different, and the specific calculation method may be determined according to the requirements of the actual application.
[0091] Optionally, based on the vertex offset, the initial vertex coordinates of each target object are offset, which may include: according to the vertex offsets corresponding to each target object, the initial vertex coordinates of each target object are added to the corresponding vertex offsets to obtain the target vertex coordinates of each target object, that is, the first target vertex coordinates of the object to be rendered.
[0092] By applying this embodiment, the vertex offset of each target object is determined in sequence according to the arrangement order and the preset offset direction; based on the vertex offset, the initial vertex coordinates of each target object are offset, and the required thickness of the object to be rendered can be achieved by offsetting the vertex position layer by layer.
[0093] In practical applications, the realization of semi-transparent effects is often achieved by mixed calculation of the pixel information of the background image and the pixel information of the object to be rendered. However, such calculation method often leads to a large transparency rendering overhead, thus affecting the overall efficiency of the system.
[0094] Based on this, in an optional embodiment of the present specification, the first rendering information may include a transparency parameter, and the environment information may include a background object and a background object position of the background object.
[0095] Accordingly, generating first rendering information of the object to be rendered based on the first target vertex coordinates and the environment information may include the following steps:
[0096] Based on the background object, determine the transparency information of the object to be rendered, and based on the first target vertex coordinates and the background object position, determine the noise area of the object to be rendered;
[0097] Determine the noise density according to the transparency information, and generate multiple noise points in the noise area according to the noise density to obtain the noise points positions of the multiple noise points;
[0098] Based on the position of the noise point, the transparency parameter corresponding to each target vertex of the object to be rendered is obtained.
[0099] Specifically, the transparency information can reflect the transparency of the object to be rendered. The background object can be understood as the scene object located behind the object to be rendered. The background object position can be understood as the position information of the background object in the target scene. The noise area can be understood as the area on the object to be rendered that needs to be processed for transparency.
[0100] In practical applications, the transparency information of the object to be rendered can be determined according to the background object, and the noise density can be determined based on the transparency information. Furthermore, the higher the transparency, the greater the noise density, and the clearer the background object that can be seen through the object to be rendered; the lower the transparency, the smaller the noise density, and the blurrier the background object that can be seen through the subject.
[0101] Optionally, determining the noise area of the object to be rendered based on the first target vertex coordinates and the background object position may include: determining the area on the object to be rendered that occludes the background object based on the first target vertex coordinates and the background object position; determining the noise area of the object to be rendered according to the area on the object to be rendered that occludes the background object.
[0102] Optionally, generating multiple noise points in the noise point area according to the noise point density and obtaining the noise point positions of the multiple noise points may include: randomly generating multiple noise points in the noise point area according to the noise point density and determining the noise point position of each noise point. It may also include: determining the noise point position of each noise point in the noise point area according to the noise point density and a preset noise point distribution rule, and generating noise points at the noise point positions.
[0103] Optionally, obtaining the transparency parameter corresponding to each target vertex of the object to be rendered based on the noise point position may include:
[0104] According to the coincidence of the first target vertex coordinates of the object to be rendered and the position of the noise point, the transparency parameter corresponding to the first target vertex coordinates is determined.
[0105] Specifically, the transparency parameter can be a value representing the degree of transparency. When the coordinates of the first target vertex coincide with the position of the noise point, the transparency parameter can be set to a parameter value corresponding to full transparency or a parameter value corresponding to semi-transparency; when the coordinates of the first target vertex do not coincide with the position of the noise point, the transparency parameter can be set to a parameter value corresponding to full opacity or a parameter value corresponding to semi-transparency.
[0106] For example, assuming that 1 represents completely opaque and 0 represents completely transparent, when the coordinates of the first target vertex coincide with the position of the noise point, the transparency parameter at the vertex can be set to 0; when the coordinates of the first target vertex do not coincide with the position of the noise point, the transparency parameter at the vertex can be set to 1. Alternatively, when the coordinates of the first target vertex coincide with the position of the noise point, the transparency parameter at the vertex can be set to a value between 0 and 1.
[0107] It should be noted that the setting rules of the transparency parameters can be specifically determined according to the requirements of actual applications, and this specification does not impose any limitation on this.
[0108] In the actual implementation process, when noise is generated and the translucent effect is achieved through the noise, the rendering effect of the object to be rendered may show an unnatural transition problem. In order to solve this problem, the dithering and anti-aliasing tools (DitherTAA) in the engine can be further used to eliminate the unnatural transition of visual effects caused by noise and improve the naturalness of color transition.
[0109] By applying this embodiment, by determining the transparency information of the object to be rendered based on the background object, and determining the noise area of the object to be rendered based on the first target vertex coordinates and the background object position, it is possible to determine the noise density according to the transparency information, and generate multiple noise points in the noise area according to the noise density to obtain the noise positions of the multiple noise points, thereby obtaining the transparency parameters corresponding to each target vertex of the object to be rendered based on the noise positions, avoiding a large amount of performance overhead and over-drawing problems caused by semi-transparent blending calculations, and improving the rendering efficiency of semi-transparent effects.
[0110] In actual applications, the engine can often provide a default lighting calculation algorithm. By setting the light source property information in the target scene, the engine can calculate the lighting parameters of the object to be rendered, thereby achieving the lighting effect of the object to be rendered.
[0111] However, since the default lighting calculation algorithm provided by the engine often includes multi-faceted parameter calculations, such as metallic glossiness, it will result in a large calculation overhead, thereby reducing the overall efficiency of the system.
[0112] Based on this, in another optional embodiment of the present specification, the first rendering information includes lighting parameters, and the environment information includes light source attribute information.
[0113] Accordingly, generating first rendering information of the object to be rendered based on the first target vertex coordinates and the environment information may include the following steps:
[0114] Based on the first target vertex coordinates and the light source attribute information, the illumination parameters corresponding to each target vertex of the object to be rendered are generated.
[0115] Specifically, the light source attribute information may include attribute information such as the light source position, light intensity, and light source color. The light parameters can represent the degree of light received by each target vertex of the object to be rendered.
[0116] Optionally, generating illumination parameters corresponding to each target vertex of the object to be rendered based on the first target vertex coordinates and the light source attribute information may include:
[0117] Determine the direction information between the light source and the target vertex according to the position of the light source and the coordinates of the first target vertex, thereby obtaining the angle between the line between the light source and the target vertex and the normal line of the plane where the target vertex is located;
[0118] The light intensity and light color corresponding to the coordinates of the first target vertex are calculated based on the angle between the line between the light source and the target vertex and the normal of the plane where the target vertex is located, as well as the light intensity and the light source color.
[0119] By applying this embodiment, by generating lighting parameters corresponding to each target vertex of the object to be rendered based on the first target vertex coordinates and the light source attribute information, the default lighting shader algorithm can be changed to a non-lighting shader algorithm, thereby reducing the lighting calculation overhead, realizing a simplified version of lighting, and improving the lighting calculation efficiency.
[0120] In an optional embodiment of the present specification, the association information may indicate that the second layout position of the associated special effect object is associated with the object to be rendered, and the object quantity of the associated special effect object is associated with the object to be rendered.
[0121] Accordingly, determining the second rendering information of the associated special effect object according to the association information between the object to be rendered and the associated special effect object may include the following steps:
[0122] Determine, based on the object to be rendered and the associated information, the number of objects of the associated special effect objects and a second layout position of the associated special effect objects;
[0123] Determine the second target vertex coordinates of the associated special effect object according to the number of objects and the second layout position;
[0124] Based on the second target vertex coordinates, second rendering information is obtained.
[0125] Specifically, the association information may indicate that there is an association relationship between the second layout position of the associated special effect object and the object to be rendered, and there is an association relationship between the object quantity of the associated special effect object and the object to be rendered.
[0126] Optionally, determining the object number of associated special effect objects and the second layout position of the associated special effect objects based on the object to be rendered and the associated information may include: determining the object number of associated special effect objects and the second layout position of the associated special effect objects based on the first layout position of the object to be rendered; and may also include: determining the object number of associated special effect objects and the second layout position of the associated special effect objects based on the first target vertex coordinates of the object to be rendered.
[0127] Specifically, the associated special effect object can be understood as a particle emitted by a particle emitter for an object to be rendered, and a particle can be modeled as a face around the object to be rendered. The associated special effect object may include multiple objects, and the number of objects and the second layout position of the associated special effect object may be different in the case of different image quality or different visual distances. The second layout position can be understood as the layout position of the associated special effect object in the target scene. The second layout position usually surrounds the first layout position. The second target vertex coordinates can be understood as the vertex coordinates on the associated special effect object face. The second rendering information can be understood as rendering information used to render the associated special effect object in the target scene.
[0128] In actual applications, the number of associated special effect objects is determined based on the object to be rendered; the second layout position is also determined based on the object to be rendered. The number of associated special effect objects and the second layout position can be determined based on the first layout position of the object to be rendered, or can be determined based on the first target vertex coordinates of the object to be rendered.
[0129] By applying this embodiment, the number of associated special effect objects and the second layout position of the associated special effect objects are determined based on the objects to be rendered and the associated information; the second target vertex coordinates of the associated special effect objects are determined according to the number of objects and the second layout position; the second rendering information is obtained based on the second target vertex coordinates, and the second rendering information can be generated according to the associated relationship, which can improve the rendering accuracy of the associated special effect objects, realize the control of the number of associated special effect objects, and effectively reduce the rendering overhead of the associated special effect objects.
[0130] In an optional embodiment of the present specification, determining the object quantity of the associated special effect object and the second layout position of the associated special effect object based on the object to be rendered and the associated information may include the following steps:
[0131] Determining a target distance between the target camera and the object to be rendered according to a camera position of the target camera and an object position of the object to be rendered, wherein the target camera is located in a target scene;
[0132] Determining a second layout position of the associated special effect object according to the object position of the object to be rendered;
[0133] Determines the number of objects to associate with the effect object based on the target distance.
[0134] Specifically, the target camera can be understood as a virtual camera in the target scene, and the target camera has a preset camera position and shooting field of view.
[0135] Optionally, the object position of the object to be rendered may be determined according to the first layout position, or may be determined according to the first target vertex coordinates of the object to be rendered.
[0136] Optionally, the target distance between the target camera and the object to be rendered can be determined based on the distance between the camera position of the target camera and the first layout position; it can also be determined based on the distance between the camera position of the target camera and the first target vertex coordinates; it can also be determined based on the distance between the camera position of the target camera and the center coordinates of the object to be rendered, wherein the center coordinates can be calculated based on the coordinates of each first target vertex.
[0137] Further, based on the target distance, determining the number of objects of the associated special effect object may include: determining whether the target distance reaches a current preset distance threshold; if so, determining the number of objects of the special effect object according to the current preset distance threshold. It may also include: determining the current distance interval in which the target distance is located; and determining the number of objects of the special effect object based on the current distance interval.
[0138] For example, assuming that the preset distance threshold is in meters, a preset distance threshold can be set every 1000 meters. When the target distance reaches the preset distance threshold, the number of objects of the associated special effect object is switched according to the number of objects corresponding to the preset distance threshold. The farther the distance is, the fewer the number of objects of the associated special effect object can be set; and the closer the distance is, the more the number of objects of the associated special effect object can be set.
[0139] Optionally, determining the second layout position of the associated special effect object according to the object position of the object to be rendered may include:
[0140] Determine a second layout position according to the first layout position;
[0141] Alternatively, the second layout position is determined according to the first target vertex coordinates.
[0142] In practical applications, the layout position of the special effect object in the target scene can be determined according to the first layout position; or the layout position of the special effect object in the target scene can be determined according to the first target vertex coordinates of the object to be rendered.
[0143] By applying this embodiment, the target distance between the target camera and the object to be rendered is determined according to the camera position of the target camera and the object position of the object to be rendered; based on the target distance, the object number of associated special effect objects is determined, and the number of associated special effect objects can be automatically controlled according to the distance calculation result, thereby realizing LOD switching and image quality grading, thereby reducing the rendering overhead caused by a large number of associated special effect objects and improving the overall efficiency of the system; and, by determining the object number and the second layout position of the associated special effect objects according to the association relationship, the rendering effect accuracy can be improved, thereby improving the user's visual experience.
[0144] In practical applications, when noise is used to achieve the translucent effect of the object to be rendered, it may cause problems of particle interlacing hard edges and a large number of particles stacking, which will affect the visual effect.
[0145] Based on this, in an optional embodiment of the present specification, determining the second target vertex coordinates of the associated special effect object according to the number of objects and the second layout position may include the following steps:
[0146] Determine the initial vertex coordinates of the associated special effect object according to the number of objects and the second layout position;
[0147] The first target vertex coordinates of the object to be rendered are obtained, and the initial vertex coordinates of the associated special effect object are transformed according to the first target vertex coordinates to obtain the second target vertex coordinates of the associated special effect object.
[0148] Specifically, the initial vertex coordinates can be understood as the initial vertex coordinates of the associated special effect object in the target scene. The second target vertex coordinates can be understood as the vertex coordinates of the associated special effect object in the target scene obtained after coordinate transformation of the initial vertex coordinates.
[0149] Optionally, determining the initial vertex coordinates of the associated special effect objects based on the number of objects and the second layout position may include: configuring a particle emitter at the second layout position, emitting the number of associated special effect objects through the particle emitter, and obtaining the initial vertex coordinates of the associated special effect objects.
[0150] In practical applications, a small number of particles can be emitted, and through the vertex deformation function, the particles can always fit the outline of the object to be rendered during movement, thereby avoiding the problem of particle interlacing hard edges and the stacking of a large number of particles.
[0151] Optionally, performing coordinate transformation on the initial vertex coordinates of the associated special effect object according to the first target vertex coordinates to obtain the second target vertex coordinates of the associated special effect object may include:
[0152] Align the initial vertex coordinates of the associated special effect object with the first target vertex coordinates to obtain the second target vertex coordinates of the associated special effect object.
[0153] Furthermore, the coordinate alignment can be calculated by normals. After the coordinate alignment is performed, the associated special effect object can be moved in accordance with the contour of the object to be rendered.
[0154] By applying this embodiment, by obtaining the first target vertex coordinates of the object to be rendered, and performing coordinate transformation on the initial vertex coordinates of the associated special effect object according to the first target vertex coordinates, the second target vertex coordinates of the associated special effect object are obtained, so that the associated special effect object can move in accordance with the contour of the object to be rendered, thereby avoiding the problem of hard edges of particles interspersed; and, by performing vertex deformation on the vertices of the associated special effect object, the sense of volume required for the rendering effect can be met by a small number of associated special effect objects, thereby avoiding the stacking of a large number of particles and reducing the rendering overhead of the associated special effect objects.
[0155] In an optional embodiment of the present specification, obtaining the second rendering information based on the second target vertex coordinates may include the following steps:
[0156] Obtaining a target special effect map corresponding to the associated special effect object, wherein the target special effect map includes a plurality of sub-special effect maps of different special effect types;
[0157] According to the second target vertex coordinates, the target special effect type of the associated special effect object is determined, and a target sub-map corresponding to the target special effect type is obtained from the target special effect map.
[0158] Specifically, the target special effect map includes a plurality of sub-special effect maps of different special effect types. One sub-special effect map corresponds to a rendering effect under one special effect type. For example, when the object to be rendered is a tornado body, the special effect types may include: smoke special effect, gravel special effect, special effect of a tornado rolling up a car, and so on.
[0159] Optionally, before obtaining the target special effect map corresponding to the associated special effect object, the following may also be included:
[0160] Get special effect maps corresponding to multiple special effect types;
[0161] The special effect maps corresponding to each special effect type are merged into the target special effect map, and the index of the special effect map in the target special effect map is generated.
[0162] Furthermore, the index of the special effect map in the target special effect map may indicate the position or arrangement order of the special effect map in the target special effect map. Through the index, the special effect map corresponding to the special effect type can be obtained from the target special effect map.
[0163] Optionally, obtaining a target sub-map corresponding to a target special effect type from a target special effect map may include:
[0164] According to the index corresponding to the target special effect type, the corresponding target sub-map is obtained from the target special effect map.
[0165] By applying this embodiment, by obtaining the target special effect map corresponding to the associated special effect object; determining the target special effect type of the associated special effect object according to the second target vertex coordinates, and obtaining the target sub-map corresponding to the target special effect type from the target special effect map, the special effect maps corresponding to each special effect type corresponding to the associated special effect object can be obtained at one time, and the special effect map corresponding to the special effect type can be obtained based on the index, thereby avoiding obtaining a special effect map every time a type of special effect is rendered, which can reduce rendering batches and reduce performance overhead.
[0166] Step 106: Rendering the object to be rendered and the associated special effect object in the target scene based on the first rendering information and the second rendering information.
[0167] In practical applications, after determining the first rendering information corresponding to the object to be rendered and the second rendering information of the associated special effect object, the object to be rendered and the associated special effect object can be rendered in the target scene based on the first rendering information and the second rendering information.
[0168] In the actual implementation process, since the engine will automatically reset the state of the animation state machine when switching LOD by default, which will cause discontinuity in the animation connection, the LOD animation state machine synchronization function can be implemented to ensure the continuity of the animation effect when switching LOD.
[0169] In an optional embodiment of the present specification, after rendering the object to be rendered and the associated special effect object in the target scene based on the first rendering information and the second rendering information, the following steps may also be included:
[0170] In response to a preset switching instruction being triggered, obtaining the animation playing state in the animation state machine before the switching;
[0171] Synchronize the animation playback state to the switched animation state machine, and play the animation based on the switched animation state machine.
[0172] Optionally, the preset switching instruction can be triggered based on the target distance reaching a preset distance threshold, or can be triggered based on image quality switching. When the preset switching instruction is triggered, it is used to perform LOD switching, that is, to change the number of objects associated with the special effect object, so that the animation state machine switches from the current state to another state, thereby changing the content of the animation being played.
[0173] Specifically, the animation state machine is used to control the playback and switching of the animation. The animation state machine before switching can be understood as the animation state machine before the state switching is performed based on the preset switching instruction. The animation playback state may include the currently playing animation and the animation playback progress. The animation state machine after switching can be understood as the animation state machine after the state switching is performed based on the preset switching instruction.
[0174] For example, assuming that when the preset distance reaches the distance threshold of 1000 meters from more than 1000 meters, the preset switching instruction will be triggered to switch the number of objects of the associated special effect objects from 10 to 20. Then, in the animation corresponding to the animation state machine before the switching, the number of objects of the associated special effect objects is 10; in the animation corresponding to the animation state machine after the switching, the number of objects of the associated special effect objects is 20. Moreover, the animation state machine after the switching will perform subsequent animation playback based on the animation content and animation playback progress before the switching.
[0175] By applying this embodiment, by synchronizing the animation playback state in the animation state machine before switching to the animation state machine after switching, and performing animation playback based on the animation state machine after switching, it is possible to achieve synchronization of animation states before and after LOD switching, ensure smooth animation connection, and improve user visual experience.
[0176] An embodiment of the present specification implements obtaining a first layout position of an object to be rendered in a target scene; determining first rendering information of the object to be rendered based on the first layout position, and determining second rendering information of the associated special effect object based on association information between the object to be rendered and the associated special effect object, wherein the associated special effect object is an object surrounding the object to be rendered; and rendering the object to be rendered and the associated special effect object in the target scene based on the first rendering information and the second rendering information.
[0177] In this way, the first rendering information of the object to be rendered is determined through the first layout position, and the second rendering information of the associated special effect object is determined based on the association information between the object to be rendered and the associated special effect object. This can improve the generation efficiency of the second rendering information of the associated special effect object and reduce the performance overhead brought by determining the second rendering information, thereby improving the rendering efficiency of the object to be rendered and the associated special effect object.
[0178] The following combination Figure 2, taking the application of the object rendering method provided in this specification in the realization of a tornado effect as an example, the object rendering method is further described. Figure 2 A processing flow chart of an object rendering method provided by an embodiment of the present specification is shown, which specifically includes the following steps.
[0179] Step 202: calling a graphics generation interface to generate a plurality of subject models, and arranging the plurality of subject models vertically at a first layout position in the target scene.
[0180] In actual applications, the main body of a tornado is composed of multiple layers. Using GPU Instancing can optimize the overhead caused by multi-layer rendering and reduce rendering batches.
[0181] Step 204: according to the instance ID of each subject model, the vertex position of each subject model is offset layer by layer along the normal direction to obtain the tornado subject model and the vertex coordinates of the tornado subject model.
[0182] In practical applications, the required thickness of the tornado body can be achieved by offsetting the vertex positions of each main model layer by layer in the normal direction.
[0183] See also Figure 3 , Figure 3 FIG. 1 is a schematic diagram showing the rendering effect of an object to be rendered in an object rendering method provided by an embodiment of the present specification. Figure 3 As shown, the tornado body includes multiple layers, and the apex offset degree of each layer is different.
[0184] Step 206: Determine the noise point density according to the transparency of the tornado main model, and generate a plurality of noise points on the tornado main model according to the noise point density.
[0185] In actual applications, tornadoes are mostly composed of fog. In games, translucent rendering is used to achieve fog effects, but since translucent blending calculations cause large system overhead, resulting in poor performance, Alpha Clipping combined with DitherTAA can be used to achieve a similar translucent effect, thereby reducing a large number of translucent blending calculations and over-drawing problems.
[0186] Step 208: Determine the number of particles according to the distance between the target camera and the main tornado model, and generate particles of the same number at a second layout position around the main tornado model.
[0187] Since particle effects are not convenient to switch LOD and image quality by switching objects, by increasing the calculated distance in the particle system, the seamless connection and on / off of particle quantity control can be achieved, and LOD switching can be achieved by distance, which can also achieve the purpose of performance control.
[0188] Step 210: Based on the vertex deformation function, the particles are made to always fit the contour of the tornado main model during the movement.
[0189] In actual applications, using Alpha Clipping technology may cause particle interlacing and a large number of particles to pile up. The vertex deformation function can make particles always fit the outline of the tornado model during movement, thus avoiding particle interlacing.
[0190] See also Figure 4 , Figure 4 A schematic diagram of interlaced performance of associated special effect objects in an object rendering method provided by an embodiment of this specification is shown. Specifically, the associated special effect objects are particles. Figure 4 In the image, Alpha Clipping generates noise, which can cause problems such as unnatural color transitions and uneven edges.
[0191] In addition, through vertex deformation, a smaller number of particles can be used to achieve the volumetric effect required, thus avoiding the stacking of a large number of particles and reducing rendering overhead.
[0192] See also Figure 5 , Figure 5 FIG. 1 is a schematic diagram showing the deformation performance of an associated special effect object in an object rendering method provided by an embodiment of the present specification. Figure 5 As shown, Figure 5 The particles in the model are deformed according to the vertex positions of the main model.
[0193] Step 212: Use the unlit shader to generate lighting information for the tornado main body model according to parameters such as the position, intensity, and color of the light source.
[0194] In actual applications, since tornadoes can have lightning effects, the lightning effects should be illuminated on tornadoes. However, using the engine's default lighting shader will bring additional rendering overhead, so you can use a non-lit shader instead, and then combine the algorithm based on the position, intensity, color and other parameters of the light source to achieve a simplified version of the lighting.
[0195] See also Figure 6 , Figure 6FIG. 1 is a schematic diagram showing the lighting performance of an object to be rendered in an object rendering method provided by an embodiment of the present specification. Figure 6 As shown, the lighting information of the tornado main model can be calculated according to the light source position, intensity, color and other parameters in the target scene, thereby realizing a simplified version of the lighting and effectively reducing the rendering overhead.
[0196] Step 214: Obtain the target special effect map, obtain the target sub-map corresponding to the particle from the target special effect map according to the index corresponding to the particle special effect type, and emit the particle according to the special effect type.
[0197] In practical applications, in order to solve the problem of a large number of tornado particle special effects, multiple maps with different performance effects can be merged into one map (i.e., the target special effect map), and then the types of special effects can be distinguished by index, so as to realize the emission of special effect particles by class. In this way, the number of visual special effects rendering batches can be reduced, effectively reducing rendering overhead.
[0198] Step 216: In the case of LOD switching, the animation state in the previous animation state machine is obtained, and the animation state in the previous animation state machine is synchronized to the current animation state machine.
[0199] In actual applications, when switching LOD, the system will reset the state of the animation state machine by default, resulting in problems with animation connection and unnatural animation transition. Therefore, when switching LOD, you can obtain the animation state in the previous animation state machine and synchronize the animation state in the previous animation state machine to the current animation state machine, thereby realizing the synchronization function of the LOD animation state machine. When switching to the next LOD, the animation state in the previous LOD animation state machine can be synchronized in time to ensure the natural and smooth animation connection.
[0200] By applying this embodiment, it is possible to reduce system rendering overhead and improve rendering efficiency, thereby achieving a tornado visual effect that takes both effect and performance into consideration.
[0201] Corresponding to the above method embodiment, this specification also provides an object rendering device embodiment, Figure 7 FIG. 1 shows a schematic diagram of the structure of an object rendering device provided by an embodiment of the present specification. Figure 7 As shown, the device comprises:
[0202] The acquisition module 702 is configured to acquire a first layout position of the object to be rendered in the target scene.
[0203] Determination module 704: is configured to determine first rendering information of the object to be rendered according to the first layout position, and determine second rendering information of the associated special effect object according to association information between the object to be rendered and the associated special effect object, wherein the associated special effect object is an object surrounding the object to be rendered.
[0204] Rendering module 706: configured to render the to-be-rendered object and the associated special effect object in the target scene based on the first rendering information and the second rendering information.
[0205] Optionally, the determination module 704 is further configured to:
[0206] Determine first target vertex coordinates and environment information of the object to be rendered according to the first layout position;
[0207] First rendering information of the object to be rendered is generated based on the first target vertex coordinates and the environment information.
[0208] Optionally, the determination module 704 is further configured to:
[0209] Calling a graphics generation interface to generate a plurality of target objects, wherein the plurality of target objects are used to form an object to be rendered, and the plurality of target objects have different size information;
[0210] Combining a plurality of target objects at a first layout position to obtain an object to be rendered and a first target vertex coordinate;
[0211] According to the first layout position, environmental information is determined.
[0212] Optionally, the determination module 704 is further configured to:
[0213] Arrange multiple target objects vertically at the layout position according to the size information of each target object, and obtain the arrangement order and initial vertex coordinates of each target object;
[0214] According to the arrangement order and the preset offset direction, the vertex offset of each target object is determined in turn;
[0215] Based on the vertex offset, the initial vertex coordinates of each target object are offset to obtain the object to be rendered and the first target vertex coordinates.
[0216] Optionally, the first rendering information includes a transparency parameter, and the environment information includes a background object and a background object position of the background object; the determination module 704 is further configured to:
[0217] Based on the background object, determine the transparency information of the object to be rendered, and based on the first target vertex coordinates and the background object position, determine the noise area of the object to be rendered;
[0218] Determine the noise density according to the transparency information, and generate multiple noise points in the noise area according to the noise density to obtain the noise points positions of the multiple noise points;
[0219] Based on the position of the noise point, the transparency parameter corresponding to each target vertex of the object to be rendered is obtained.
[0220] Optionally, the first rendering information includes lighting parameters, and the environment information includes light source attribute information; the determination module 704 is further configured to:
[0221] Based on the first target vertex coordinates and the light source attribute information, the illumination parameters corresponding to each target vertex of the object to be rendered are generated.
[0222] Optionally, the association information indicates that there is an association relationship between the second layout position of the associated special effect object and the object to be rendered, and there is an association relationship between the object quantity of the associated special effect object and the object to be rendered; the determination module 704 is further configured to:
[0223] Determine, based on the object to be rendered and the associated information, the number of objects of the associated special effect objects and a second layout position of the associated special effect objects;
[0224] Determine the second target vertex coordinates of the associated special effect object according to the number of objects and the second layout position;
[0225] Based on the second target vertex coordinates, second rendering information is obtained.
[0226] Optionally, the determination module 704 is further configured to:
[0227] Determining a target distance between the target camera and the object to be rendered according to a camera position of the target camera and an object position of the object to be rendered, wherein the target camera is located in a target scene;
[0228] Determining a second layout position of the associated special effect object according to the object position of the object to be rendered;
[0229] Determines the number of objects to associate with the effect object based on the target distance.
[0230] Optionally, the determination module 704 is further configured to:
[0231] Determine the initial vertex coordinates of the associated special effect object according to the number of objects and the second layout position;
[0232] The first target vertex coordinates of the object to be rendered are obtained, and the initial vertex coordinates of the associated special effect object are transformed according to the first target vertex coordinates to obtain the second target vertex coordinates of the associated special effect object.
[0233] Optionally, the determination module 704 is further configured to:
[0234] Obtaining a target special effect map corresponding to the associated special effect object, wherein the target special effect map includes a plurality of sub-special effect maps of different special effect types;
[0235] According to the second target vertex coordinates, the target special effect type of the associated special effect object is determined, and a target sub-map corresponding to the target special effect type is obtained from the target special effect map.
[0236] Optionally, the object rendering device further includes a switching module configured to:
[0237] In response to a preset switching instruction being triggered, obtaining the animation playing state in the animation state machine before the switching;
[0238] Synchronize the animation playback state to the switched animation state machine, and play the animation based on the switched animation state machine.
[0239] By applying this embodiment, the first rendering information of the object to be rendered is determined through the first layout position, and the second rendering information of the associated special effect object is determined based on the association information between the object to be rendered and the associated special effect object. This can improve the generation efficiency of the second rendering information of the associated special effect object and reduce the performance overhead brought by determining the second rendering information, thereby improving the rendering efficiency of the object to be rendered and the associated special effect object.
[0240] The above is a schematic scheme of an object rendering device of this embodiment. It should be noted that the technical scheme of the object rendering device and the technical scheme of the object rendering method described above are of the same concept, and the details not described in detail in the technical scheme of the object rendering device can be referred to the description of the technical scheme of the object rendering method described above.
[0241] Figure 8 The block diagram of a computing device 800 according to an embodiment of the present specification is shown. The components of the computing device 800 include but are not limited to a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and a database 850 is used to store data.
[0242] The computing device 800 also includes an access device 840 that enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 840 may include one or more of any type of network interface, wired or wireless (e.g., a network interface card (NIC)), such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, and a Near Field Communication (NFC).
[0243] In one embodiment of the present specification, the above components of the computing device 800 and Figure 8 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 8 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0244] The computing device 800 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 800 may also be a mobile or stationary server.
[0245] The processor 820 is used to execute the following computer executable instructions, which implement the steps of the above-mentioned object rendering method when executed by the processor.
[0246] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the object rendering method described above are of the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the object rendering method described above.
[0247] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which can implement the steps of the above-mentioned object rendering method when executed by a processor.
[0248] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the object rendering method described above are of the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the object rendering method described above.
[0249] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned object rendering method when executed by a processor.
[0250] The above is a schematic solution of a computer program product of this embodiment. It should be noted that the technical solution of the computer program product and the technical solution of the object rendering method described above are of the same concept, and the details not described in detail in the technical solution of the computer program product can be found in the description of the technical solution of the object rendering method described above.
[0251] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0252] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0253] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0254] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0255] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. An object rendering method, characterized in that: include: Get the first layout position of the object to be rendered in the target scene; Determine first rendering information of the object to be rendered according to the first layout position, and determine second rendering information of the associated special effect object according to association information between the object to be rendered and an associated special effect object, wherein the associated special effect object is an object surrounding the object to be rendered; Based on the first rendering information and the second rendering information, the object to be rendered and the associated special effect object are rendered in the target scene.
2. The method according to claim 1, characterized in that The determining, according to the first layout position, first rendering information of the object to be rendered includes: Determining first target vertex coordinates and environment information of the object to be rendered according to the first layout position; First rendering information of the object to be rendered is generated based on the first target vertex coordinates and the environment information.
3. The method according to claim 2, characterized in that Before determining the first rendering information of the object to be rendered according to the first layout position, the method further includes: Calling a graphics generation interface to generate a plurality of target objects, wherein the plurality of target objects are used to form the object to be rendered, and the plurality of target objects have different size information; The step of determining target vertex coordinates and environment information of the object to be rendered according to the first layout position includes: Combining the multiple target objects at the first layout position to obtain the object to be rendered and the first target vertex coordinates; The environmental information is determined according to the first layout position.
4. The method according to claim 3, characterized in that The combining the plurality of target objects at the first layout position to obtain the object to be rendered and the first target vertex coordinates includes: Arrange the plurality of target objects vertically at the layout position according to the size information of each target object, and obtain an arrangement order and initial vertex coordinates of each target object; According to the arrangement order and the preset offset direction, the vertex offset of each target object is determined in sequence; Based on the vertex offset, initial vertex coordinates of each target object are offset to obtain the object to be rendered and the first target vertex coordinates.
5. The method according to claim 2, characterized in that: The first rendering information includes a transparency parameter, and the environment information includes a background object and a background object position of the background object; The step of generating first rendering information of the object to be rendered based on the first target vertex coordinates and the environment information includes: Based on the background object, determining transparency information of the object to be rendered, and based on the first target vertex coordinates and the background object position, determining a noise area of the object to be rendered; Determine the noise point density according to the transparency information, and generate a plurality of noise points in the noise point area according to the noise point density to obtain the noise point positions of the plurality of noise points; Based on the noise point position, a transparency parameter corresponding to each target vertex of the object to be rendered is obtained.
6. The method according to claim 2, characterized in that The first rendering information includes lighting parameters, and the environment information includes light source attribute information; The step of generating first rendering information of the object to be rendered based on the first target vertex coordinates and the environment information includes: Based on the first target vertex coordinates and the light source attribute information, illumination parameters corresponding to each target vertex of the object to be rendered are generated.
7. The method according to any one of claims 1 to 6, characterized in that: The association information indicates that a second layout position of the associated special effect object is associated with the object to be rendered, and a number of the associated special effect object is associated with the object to be rendered; The determining, according to the association information between the object to be rendered and the associated special effect object, second rendering information of the associated special effect object comprises: Based on the object to be rendered and the associated information, determining the object quantity of the associated special effect object and a second layout position of the associated special effect object; Determining the second target vertex coordinates of the associated special effect object according to the number of objects and the second layout position; Based on the second target vertex coordinates, the second rendering information is obtained.
8. The method according to claim 7, characterized in that The determining, based on the to-be-rendered object and the associated information, the number of the associated special effect objects and the second layout position of the associated special effect objects comprises: Determining a target distance between the target camera and the object to be rendered according to a camera position of a target camera and an object position of the object to be rendered, wherein the target camera is located within the target scene; Determining a second layout position of the associated special effect object according to the object position of the object to be rendered; Based on the target distance, the object quantity of the associated special effect object is determined.
9. The method according to claim 7, characterized in that: The determining, according to the number of objects and the second layout position, the second target vertex coordinates of the associated special effect object comprises: Determining initial vertex coordinates of the associated special effect object according to the number of objects and the second layout position; The first target vertex coordinates of the object to be rendered are acquired, and the initial vertex coordinates of the associated special effect object are transformed according to the first target vertex coordinates to obtain the second target vertex coordinates of the associated special effect object.
10. The method according to claim 7, characterized in that The obtaining the second rendering information based on the second target vertex coordinates includes: Acquire a target special effect map corresponding to the associated special effect object, wherein the target special effect map includes a plurality of sub-special effect maps of different special effect types; According to the second target vertex coordinates, a target special effect type of the associated special effect object is determined, and a target sub-map corresponding to the target special effect type is obtained from the target special effect map.
11. The method according to claim 1, characterized in that: After rendering the object to be rendered and the associated special effect object in the target scene based on the first rendering information and the second rendering information, the method further includes: In response to a preset switching instruction being triggered, obtaining the animation playing state in the animation state machine before the switching; The animation playing state is synchronized to the switched animation state machine, and the animation is played based on the switched animation state machine.
12. An object rendering device, characterized in that: include: An acquisition module is configured to acquire a first layout position of the object to be rendered in the target scene; a determination module configured to determine first rendering information of the object to be rendered according to the first layout position, and to determine second rendering information of the associated special effect object according to association information between the object to be rendered and an associated special effect object, wherein the associated special effect object is an object surrounding the object to be rendered; A rendering module is configured to render the object to be rendered and the associated special effect object in the target scene based on the first rendering information and the second rendering information.
13. A computing device, characterized in that: include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the object rendering method described in any one of claims 1 to 11 are implemented.
14. A computer-readable storage medium, characterized in that: It stores a computer program / instruction, which, when executed by a processor, implements the steps of the object rendering method described in any one of claims 1 to 11.
15. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, implements the steps of the object rendering method according to any one of claims 1 to 11.
