Virtual scene rendering method and apparatus, electronic device and storage medium
Through the rendering scheme and identification processing of terminal devices matching, the problem that virtual vegetation does not conform to natural laws is solved, realizing the distribution of virtual objects of natural laws and smooth rendering across hardware terminals.
Patent Information
- Application Number
- PCT/CN2025/071876
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-02-19
- Filing Date
- 2025-01-10
- Publication Date
- 2025-08-28
AI Technical Summary
When creating large three-dimensional natural scenes, randomly generated virtual vegetation often fails to conform to natural laws, resulting in unreasonable distribution of vegetation, affecting user experience, and it is difficult for different hardware devices to achieve smooth rendering of the same virtual scene.
By determining the rendering scheme that matches the terminal device type, the virtual object combination is identified, and the virtual scene is rendered according to the identification, so that the main virtual object and the slave virtual object comply with the specified combination distribution rules, and objects that do not conform to the natural laws are deleted to adapt to the rendering capabilities of different hardware devices.
It realizes the natural regular distribution of virtual objects in virtual scenes, improves the artistic effect, and the same virtual scene can be rendered smoothly on different hardware terminals.
Smart Images

Figure CN2025071876_28082025_PF_FP_ABST
Abstract
Description
Virtual scene rendering method, device, electronic device and storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese patent application number 202410184236.9, filed on February 19, 2024, entitled “Method, device, electronic device and storage medium for rendering virtual scenes”. The entire contents of the Chinese patent application are incorporated herein by reference. Technical Field
[0003] The present disclosure relates to the technical field of virtual scene rendering, and in particular to a virtual scene rendering method, device, electronic device, and storage medium. Background Art
[0004] This section is intended to provide a background or context to the embodiments of the present disclosure that are recited in the claims. No statement herein is admitted to be prior art by virtue of its inclusion in this section.
[0005] At present, when making large-scale three-dimensional natural game scenes (areas are usually greater than 1 square kilometer), if virtual objects, such as virtual vegetation, are placed by artificial placement, it will be very boring and time-consuming, and it will not accurately restore the natural laws of plant community growth. Therefore, in the related art, when making large-scale three-dimensional natural scenes, vegetation is often randomly generated in a programmatic manner. However, the randomly generated virtual vegetation often has a distribution of virtual vegetation that does not conform to the laws of nature. For example, around core vegetation species such as tall trees, subsidiary vegetation species such as low shrubs will be generated, and around the low shrubs, small flowers and grass will be generated, thus presenting a sense of layering. However, randomly generating virtual vegetation cannot guarantee that subsidiary vegetation species such as low shrubs are distributed around core vegetation objects such as tall trees. Summary of the Invention
[0006] In view of this, the purpose of the present disclosure is to provide a virtual scene rendering method, device, electronic device and storage medium to solve or partially solve the problems in the above-mentioned background technology.
[0007] Based on the above objectives, the present disclosure provides a method for rendering a virtual scene, which is applied to a terminal device. The virtual scene includes multiple virtual object combinations, each of which includes at least one master virtual object and multiple slave virtual objects arranged around the master virtual object. The method includes:
[0008] In response to a rendering instruction for the virtual scene, determining a rendering scheme that matches the type of the terminal device;
[0009] performing a first identification on the main virtual object of the plurality of virtual object combinations according to the rendering scheme, so as to identify each main virtual object in the plurality of virtual object combinations as a first virtual object and a second virtual object, wherein different identifications are used to represent different retention tendencies;
[0010] performing a second identification on each slave virtual object within a virtual object group whose master virtual object is identified as the first virtual object, and performing a third identification on each slave virtual object within a virtual object group whose master virtual object is identified as the second virtual object, to characterize the influence of different retention tendencies of surrounding master virtual objects on each slave virtual object in the virtual scene;
[0011] The plurality of virtual object combinations in the virtual scene are rendered in the terminal device according to the first identifier, the second identifier, and the third identifier, so that the master virtual object and the slave virtual object in each virtual object combination generated by rendering conform to a specified combination distribution rule.
[0012] Based on the same inventive concept, the exemplary embodiments of the present disclosure further provide a virtual scene rendering device, which is applied to a terminal device. The virtual scene includes multiple virtual object combinations, each of which includes at least one master virtual object and multiple slave virtual objects arranged around the master virtual object. The device includes:
[0013] a determination module configured to respond to a rendering instruction for the virtual scene and determine a rendering scheme that matches the type of the terminal device;
[0014] a first identification module configured to perform a first identification on the primary virtual object of the plurality of virtual object combinations according to the rendering scheme, so as to identify each primary virtual object in the plurality of virtual object combinations as a first virtual object and a second virtual object, wherein different identifications are used to represent different retention tendencies;
[0015] a second identification module configured to perform a second identification on each slave virtual object in a virtual object group whose master virtual object is identified as the first virtual object, and to perform a third identification on each slave virtual object in a virtual object group whose master virtual object is identified as the second virtual object, so as to characterize the influence of different retention tendencies of surrounding master virtual objects on each slave virtual object in the virtual scene;
[0016] The rendering module is configured to render the multiple virtual object combinations in the virtual scene in the terminal device according to the first identifier, the second identifier and the third identifier, so that the main virtual object and the slave virtual object in each virtual object combination generated by rendering conform to the specified combination distribution law.
[0017] Based on the same inventive concept, an exemplary embodiment of the present disclosure further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the virtual scene rendering method as described above when executing the program.
[0018] Based on the same inventive concept, an exemplary embodiment of the present disclosure further provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the virtual scene rendering method as described above.
[0019] Based on the same inventive concept, exemplary embodiments of the present disclosure further provide a computer program product, which includes a computer program. The computer program is executed by one or more processors to enable the processors to perform the game sound adjustment method as described above.
[0020] As can be seen from the above, the present disclosure provides a method, device, electronic device, and storage medium for rendering a virtual scene. The method includes responding to a rendering instruction for the virtual scene and determining a rendering scheme that matches the type of the terminal device; performing a first identification on the master virtual object of the plurality of virtual object combinations according to the rendering scheme, so as to identify each master virtual object in the plurality of virtual object combinations as a first virtual object and a second virtual object, wherein different identifications are used to represent different retention tendencies; performing a second identification on each slave virtual object in the virtual object combination whose master virtual object is identified as the first virtual object, and performing a third identification on each slave virtual object in the virtual object combination whose master virtual object is identified as the second virtual object. an identifier to characterize the influence of different retention tendencies of the surrounding main virtual objects on each slave virtual object in the virtual scene; and rendering the multiple virtual object combinations in the virtual scene in the terminal device according to the first identifier, the second identifier and the third identifier, so that the main virtual objects and the slave virtual objects in each virtual object combination generated by rendering conform to the specified combination distribution law, thereby making it possible to delete virtual objects that do not conform to the laws of nature from the virtual scene, so that the virtual objects retained in the final virtual scene conform to the laws of nature, and improving the artistic effect of the distribution of virtual objects. At the same time, different rendering schemes can be formulated for different types of terminal devices, so that the same virtual scene can be smoothly rendered in real time in multiple hardware terminals. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0022] FIG1 is a schematic diagram of an application scenario of one embodiment of the present disclosure;
[0023] FIG2 is a schematic flow chart of a method for rendering a virtual scene according to one embodiment of the present disclosure;
[0024] FIG3 is a schematic diagram of virtual vegetation distribution that conforms to natural laws according to one embodiment of the present disclosure;
[0025] FIG4 is a schematic diagram of a virtual vegetation distribution that does not conform to natural laws in the related art;
[0026] FIG5 is a schematic diagram of another virtual vegetation distribution that does not conform to natural laws in the related art;
[0027] FIG6 is a schematic diagram of a first identification of the main virtual object of the combination of multiple virtual objects according to one embodiment of the present disclosure;
[0028] FIG7 is a schematic diagram of an effect of rendering the combination of the multiple virtual objects in the virtual scene according to one embodiment of the present disclosure;
[0029] FIG8 is a schematic diagram showing another embodiment of the present disclosure showing the combined effect of the multiple virtual objects in the virtual scene;
[0030] FIG9 is a schematic structural diagram of a virtual scene rendering device according to one embodiment of the present disclosure;
[0031] FIG10 is a schematic structural diagram of a specific electronic device according to one embodiment of the present disclosure. DETAILED DESCRIPTION
[0032] The principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided solely to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. Rather, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0033] It should be noted that, unless otherwise defined, technical or scientific terms used in the embodiments of the present disclosure should have the ordinary meaning understood by a person of ordinary skill in the art to which the present disclosure belongs. The terms "first," "second," and similar expressions used in the embodiments of the present disclosure do not indicate any order, quantity, or importance, but are simply used to distinguish different components. Terms such as "include" or "comprising" mean that the element or object preceding the term includes the elements or objects listed after the term, and their equivalents, without excluding other elements or objects. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to the process, method, product, or device. Terms such as "connected" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; if the absolute position of the described object changes, the relative positional relationship may also change accordingly. Additionally, in this disclosure, unless otherwise specified, the term "plurality" refers to two or more. The term "and / or" describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0034] According to an embodiment of the present disclosure, a method, system, electronic device, and storage medium for rendering a virtual scene are proposed.
[0035] It should be understood herein that any number of elements in the drawings is for illustration only and not for limitation, and any naming is only for distinction and does not have any limiting meaning.
[0036] The principles and spirit of the present disclosure are explained in detail below with reference to several representative embodiments of the present disclosure.
[0037] SUMMARY OF THE INVENTION
[0038] In current related technologies, when creating large-scale three-dimensional natural scenes, a programmatic approach is often used to randomly generate vegetation. However, randomly generated virtual vegetation often results in a distribution of virtual vegetation that does not conform to natural laws. For example, around core vegetation species such as tall trees, subsidiary vegetation species such as low shrubs are generated, and around the low shrubs, small flowers and grasses are generated, thus presenting a sense of layering. However, randomly generating virtual vegetation does not guarantee that subsidiary vegetation species such as low shrubs are distributed around core vegetation species such as tall trees. Referring to Figure 3, in order to generate a virtual vegetation distribution that conforms to natural laws in the embodiments of the present disclosure, it can be seen that multiple low shrubs are distributed around the tall vegetation in Figure 3. However, in related technologies, since virtual vegetation is randomly generated, it is impossible to guarantee that the vegetation conforms to the vegetation distribution shown in Figure 3. Referring to Figures 4 and 5, two vegetation distributions obtained after randomly generating virtual vegetation in related technologies, among which Figure 4 clearly shows that there are no tall vegetation, and only multiple low shrubs are distributed together, which clearly does not conform to natural laws. Figure 5 only includes tall vegetation, with no surrounding low shrubs. This is inconsistent with natural patterns, and if gamers encounter the vegetation distribution shown in Figures 4 and 5, the user experience will be significantly impacted. Furthermore, because different hardware devices have varying graphics computing capabilities, different numbers of objects must be rendered within the scene for devices with varying computing power levels to ensure smooth real-time rendering. Therefore, prior art has made it impossible to apply the same virtual scene to different hardware levels.
[0039] In order to solve the above problems, the present disclosure provides a method for rendering a virtual scene, which specifically includes:
[0040] In response to a rendering instruction for the virtual scene, a rendering scheme matching the type of the terminal device is determined; a first identification is performed on the master virtual object of the plurality of virtual object combinations according to the rendering scheme, so as to identify each master virtual object in the plurality of virtual object combinations as a first virtual object and a second virtual object, wherein different identifications are used to represent different retention tendencies; a second identification is performed on each slave virtual object in the virtual object combination whose master virtual object is identified as the first virtual object, and a third identification is performed on each slave virtual object in the virtual object combination whose master virtual object is identified as the second virtual object, so as to represent that each slave virtual object in the virtual scene is retained by the surrounding virtual object. The influence of different retention tendencies of the main and side virtual objects; rendering the multiple virtual object combinations in the virtual scene in the terminal device according to the first identifier, the second identifier and the third identifier, so that the main virtual objects and the slave virtual objects in each virtual object combination generated by rendering conform to the specified combination distribution law, thereby achieving the deletion of virtual objects that do not conform to the laws of nature from the virtual scene, so that the virtual objects retained in the final virtual scene conform to the laws of nature, and improving the artistic effect of the distribution of virtual objects. At the same time, different rendering schemes can be formulated for different types of terminal devices, so that the same virtual scene can be smoothly rendered in real time in multiple hardware terminals.
[0041] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below.
[0042] Application Scenario Overview
[0043] In some specific application scenarios, the virtual scene rendering method disclosed in the present invention can be applied to various systems involving virtual scene rendering. Optionally, the system can be a game system. As an example, referring to Figure 1, the application scenario includes at least one server 102 and at least one terminal 101. Terminal devices include but are not limited to desktop computers, mobile phones, mobile computers, tablet computers, media players, smart wearable devices, personal digital assistants (PDAs) or other electronic devices that can realize the above functions. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (content distribution network), and big data and artificial intelligence platforms. The server and the terminal can communicate through the network to realize data transmission. Among them, the network can be a wired network or a wireless network, and the present disclosure does not make specific limitations on this.
[0044] The server can be a server that provides various services. Specifically, the server can be used to provide background services for applications running on the terminal. Optionally, in some implementations, the virtual scene rendering method provided by the embodiment of the present disclosure can be executed by a terminal device or a server. When executed by the server, the server first determines a rendering scheme that matches the type of the terminal device; according to the rendering scheme, the main virtual object of the multiple virtual object combinations is first identified to identify each main virtual object in the multiple virtual object combinations as a first virtual object and a second virtual object, wherein different identifications are used to represent different retention tendencies; a second identification is performed on each slave virtual object in the virtual object combination whose main virtual object is identified as the first virtual object, and a third identification is performed on each slave virtual object in the virtual object combination whose main virtual object is identified as the second virtual object, to represent the influence of the different retention tendencies of the surrounding main virtual objects on each slave virtual object in the virtual scene; the multiple virtual object combinations in the virtual scene are rendered in the terminal device according to the first identification, the second identification, and the third identification, so that the main virtual object and the slave virtual object in each virtual object combination generated by rendering conform to the specified combination distribution law. Optionally, the server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, software or software modules used to provide distributed services), or as a single software or software module. This is not specifically limited in the present embodiment.
[0045] Optionally, the above-mentioned wireless network or wired network uses standard communication technology and / or protocol. The network is typically the Internet, but can also be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a private network or any combination of a virtual private network). In some embodiments, technologies and / or formats including hypertext markup language (HTML), extensible markup language (XML), etc. are used to represent data exchanged over the network. In addition, conventional encryption technologies such as secure socket layer (SSL), transport layer security (TLS), virtual private network (VPN), and internet protocol security (IPsec) can be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above-mentioned data communication technologies.
[0046] The following describes a method for rendering a virtual scene according to an exemplary embodiment of the present disclosure, with reference to specific application scenarios. It should be noted that the aforementioned application scenarios are merely provided to facilitate understanding of the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. Rather, the embodiments of the present disclosure can be applied to any applicable scenario.
[0047] It should be understood that, although the various steps in the flowchart of FIG2 are shown in sequence according to the instructions of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in FIG2 may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0048] Exemplary Methods
[0049] 2 , an embodiment of the present disclosure provides a method for rendering a virtual scene, which is applied to a terminal device. The virtual scene includes multiple virtual object combinations, each of which includes at least one master virtual object and multiple slave virtual objects arranged around the master virtual object. The method includes the following steps:
[0050] S101 : In response to a rendering instruction for the virtual scene, determine a rendering solution that matches the type of the terminal device.
[0051] During specific implementation, the virtual scene can be a virtual scene in a game scene. The virtual object can be a virtual plant in the game scene, and the virtual vegetation can include various types of virtual vegetation, such as tall trees, shrubs, etc. The virtual scene includes multiple virtual object combinations, and each virtual object combination includes at least one main virtual object and multiple slave virtual objects configured around the main virtual object. The main virtual object and the slave virtual object can be divided according to the type of virtual object. For example, the main virtual object can be a tall tree in the game scene, and the slave virtual object is the shrub around the tall tree. It should be noted that there can be partial overlap between multiple virtual object combinations, and in each virtual object combination, the distance between the slave virtual object and the main training object is less than or equal to the preset distance.
[0052] In this step, when the terminal device receives the rendering instruction for the virtual scene, it can first determine the rendering scheme that matches the type of the terminal device. Optionally, the rendering schemes corresponding to different types of terminal devices can be set in advance. The rendering scheme mainly refers to the distribution ratio of the main virtual objects that need to be retained and the main virtual objects that need to be optimized and deleted in the main virtual objects that include a combination of multiple virtual objects in the virtual scene. Optionally, the types of terminal devices may include game consoles, host computers, mobile devices, etc. The more excellent the performance of the terminal device type, the greater the corresponding distribution ratio. For example, the distribution ratio of certain three types can be in the order from large to small: game consoles, host computers, and mobile devices, that is, the number of main virtual objects retained by the game console by default is greater than that of the host computer and greater than that of the mobile device.
[0053] S102: Perform a first identification on the main virtual object of the plurality of virtual object combinations according to the rendering scheme, so as to identify each main virtual object in the plurality of virtual object combinations as a first virtual object and a second virtual object, wherein different identifications are used to represent different retention tendencies.
[0054] During specific implementation, after determining the rendering scheme according to the type of the terminal device, the main virtual object of the combination of the multiple virtual objects can be first identified according to the rendering scheme. Optionally, the main virtual object marked with the first identifier can be determined as the first virtual object, and the main virtual object not marked with the first identifier can be determined as the second virtual object. Optionally, the first virtual object and the second virtual object can also be interchanged as needed, and there is no limitation on this. It should be noted that different identifiers are used to represent different retention tendencies. For example, different identifiers can be used to reduce or increase the retention value of the marked virtual object. The larger the retention value, the easier it is to be retained, and the smaller the retention value, the easier it is to be optimized and deleted. In this embodiment, in order to facilitate distinction, the main virtual object marked with the first identifier can be determined as the second virtual object, and the first identifier will reduce the retention value of the second virtual object, that is, the second virtual object can be the virtual object that needs to be deleted during the rendering process.
[0055] In some embodiments, performing a first identification on the main virtual object of the combination of the multiple virtual objects according to the rendering scheme specifically includes:
[0056] determining a distribution ratio of the first virtual object and the second virtual object according to the rendering scheme;
[0057] The primary virtual object is randomly first identified based on the allocation ratio.
[0058] During specific implementation, the distribution ratio of the first virtual object and the second virtual object can be determined first according to the rendering scheme. Generally speaking, the more excellent the performance corresponding to the type of terminal device, the higher the corresponding distribution ratio. For example, when the type of terminal device is a host computer, the distribution ratio of the first virtual object and the second virtual object can be: 60%:40%. When the type of terminal device is a mobile device (mobile phone), the distribution ratio of the first virtual object and the second virtual object can be: 40%:60%. After determining the distribution ratio, the main virtual object can be randomly identified as the first virtual object or the second virtual object according to the distribution ratio. That is, each main virtual object is randomly identified as the first virtual object or the second virtual object according to the distribution ratio.
[0059] In some embodiments, performing a first identification on the main virtual object of the combination of the multiple virtual objects according to the rendering scheme specifically includes:
[0060] determining a distribution ratio of the first virtual object and the second virtual object according to the rendering scheme;
[0061] Acquire an arrangement sequence number of each of the primary virtual objects, and perform a first identification on the primary virtual object based on the arrangement sequence number and the allocation ratio.
[0062] During specific implementation, considering that each virtual object in the virtual scene will be assigned a sequence number by the system, it should be noted that the sequence number generally has no relationship with the position of the virtual object. Therefore, after determining the allocation ratio of the first virtual object and the second virtual object, the primary virtual object can be first identified according to the sequence number and the allocation ratio of each primary virtual object. For example, if the allocation ratio of a first virtual object and a second virtual object is 40%:60%, and the sequence number of the primary virtual object is 1 to 100, the primary virtual object with a sequence number in the first 40 can be determined as the first virtual object, and the primary virtual object with a sequence number in the last 40 can be determined as the second virtual object.
[0063] In some embodiments, performing a first identification on the main virtual object of the combination of the multiple virtual objects according to the rendering scheme specifically includes:
[0064] determining a distribution ratio of the first virtual object and the second virtual object according to the rendering scheme;
[0065] Determining preset coordinate values based on the allocation ratio;
[0066] Obtaining target position coordinates of each of the primary virtual objects in the virtual scene;
[0067] The main virtual object is first identified based on the target position coordinates and the preset coordinate values.
[0068] During specific implementation, in order to further ensure the randomness of the first identification, the target position coordinates of each of the main virtual objects in the virtual scene can be obtained first, and then the main virtual object can be first identified based on the target position coordinates and the preset coordinate values. The target position coordinates can be any component coordinate in the three-dimensional coordinates or the two-dimensional coordinates. The preset coordinate value can be determined according to the distribution ratio of the first virtual object and the second virtual object, that is, different preset coordinate values can be set for different distribution ratios, or the distribution ratio can be directly proportional to the preset coordinate value, that is, the larger the distribution ratio, the larger the preset coordinate value. Optionally, the main virtual object can be first identified based on a certain digit value in the target position coordinates. For example, a main virtual object whose target position coordinates have a digit value greater than 5 is determined as the first virtual object. A main virtual object whose target position coordinates have a digit value less than or equal to 5 is determined as the second virtual object.
[0069] In some embodiments, performing a first identification on the primary virtual object based on the target position coordinates and the preset coordinate values specifically includes:
[0070] In response to determining that the decimal point portion of the target position coordinates of the primary virtual object is greater than or equal to the preset coordinate value, identifying the primary virtual object as a first virtual object;
[0071] In response to determining that the decimal point portion of the target position coordinates of the main virtual object is smaller than the preset coordinate value, the main virtual object is identified as a second virtual object.
[0072] In a specific implementation, when it is determined that the decimal point part of the target position coordinates of the main virtual object is greater than or equal to the preset coordinate value, the main virtual object is identified as the first virtual object; when it is determined that the decimal point part of the target position coordinates of the main virtual object is less than the preset coordinate value, the main virtual object is identified as the second virtual object.
[0073] S103, performing a second identification on each slave virtual object in the virtual object group whose main virtual object is identified as the first virtual object, and performing a third identification on each slave virtual object in the virtual object group whose main virtual object is identified as the second virtual object, so as to characterize the influence of different retention tendencies of the surrounding main virtual objects on each slave virtual object in the virtual scene.
[0074] In a specific implementation, after the first virtual object and the second virtual object are determined by the first identification, further, a second identification is performed on each slave virtual object in the virtual object combination whose main virtual object is identified as the first virtual object, and a third identification is performed on each slave virtual object in the virtual object combination whose main virtual object is identified as the second virtual object. Considering that virtual objects in virtual scenes often need to conform to certain generation rules, for example, shrubs in nature grow by relying on tall trees, therefore, when optimizing and deleting some virtual objects, the mutual influence of various virtual objects needs to be considered. For example, in a certain virtual object combination, when the main virtual object is a tall tree and the slave virtual object is a shrub, if the tall tree is deleted, the shrubs in the combination will have a reduced tendency to exist due to the lack of dependence on the tall tree. If these shrubs do not have other tall trees to rely on, they are likely to be deleted.
[0075] In some embodiments, the first virtual object may be a retained primary virtual object, in which case the second identifier is used to increase the retention tendency of the secondary virtual objects in the combination. The second virtual object may be a deleted primary virtual object, in which case the third identifier is used to decrease the retention tendency of the secondary virtual objects in the combination.
[0076] S104: Rendering the plurality of virtual object combinations in the virtual scene in the terminal device according to the first identifier, the second identifier, and the third identifier, so that the master virtual object and the slave virtual object in each virtual object combination generated by rendering conform to a specified combination distribution rule.
[0077] In specific implementation, after the first identification, the second identification and the third identification are performed, the multiple virtual object combinations in the virtual scene can be rendered according to the above three identifications, so that the main virtual objects and the slave virtual objects in each virtual object combination generated by rendering conform to the specified combination distribution law, and at the same time, the rendered virtual scene matches the type of the terminal device.
[0078] In some embodiments, the second virtual object and only the secondary virtual objects with the third identifier can be deleted during the rendering process. Alternatively, the second virtual object and all secondary virtual objects with the third identifier can be deleted during the rendering process. The specific rendering method to be used can be determined based on the performance of the terminal device. When the performance of the terminal device is high, a rendering scheme that retains more virtual object data can be selected as much as possible. When the performance of the terminal device is low, a rendering scheme that retains less virtual object data can be selected as much as possible.
[0079] In some embodiments, rendering the plurality of virtual object combinations in the virtual scene according to the first identifier, the second identifier, and the third identifier in the terminal device specifically includes:
[0080] determining a retention value of the primary virtual object based on the first identifier;
[0081] determining a retention value of the slave virtual object based on the second identifier and the third identifier;
[0082] The main virtual object and the slave virtual object whose retention value is less than the preset retention value are deleted from the multiple virtual object combinations in the virtual scene to complete the rendering in the virtual scene; wherein, the preset retention value is determined by the hardware conditions of the terminal device.
[0083] During specific implementation, the retention value of each virtual object can be determined based on different identifiers, and then the virtual objects whose retention value is less than the preset retention value are deleted from the virtual scene. Optionally, the preset retention value can be set as needed, and there is no limitation on this. For example, the preset retention value can be set to 0, and then after passing through different identifiers, the retention value of each virtual object can be re-determined, and when the retention value is less than 0, it is deleted from the virtual scene. Optionally, each virtual object can be set with an initial retention value, for example, and then different identifiers are used to affect the initial retention data. For example, after the first identification, the retention value of the first virtual object remains unchanged or increases, and the retention value of the second virtual object decreases. After the second identification, the retention value of the virtual object increases. After the third identification, the retention value of the virtual object decreases.
[0084] It should be noted that the preset retention value can be determined by the hardware conditions of the terminal device, wherein the more excellent the hardware conditions of the terminal device, the higher the corresponding performance, and therefore the smaller the corresponding preset retention value, so that more virtual objects can be retained. Optionally, the hardware condition of the terminal device can be the CPU performance score of the specific device. Referring to Figure 6, it is a schematic diagram of the attribute labels of various virtual vegetation, wherein the white tall trees are the first virtual objects, the black diagonal tall trees are the second virtual objects, and the oval dotted box corresponding to each tall tree is the influence range of the tall trees, that is, each oval dotted box is a virtual object combination. The short black vegetation in Figure 6 is a slave virtual object. Under normal circumstances, in addition to referring to its own initial retention value, each slave virtual object also needs to consider the influence of the main virtual object, that is, whether the second identification and / or third identification has been performed. When the hardware conditions of the terminal device are poor, the preset retention value can be set to a larger value, so that as many virtual objects as possible can be deleted to ensure the smooth operation of the device. At this time, the vegetation distribution result shown in Figure 7 can be obtained. It can be seen that the secondary virtual objects belonging to the combination of two virtual objects are deleted when the preset retention value is large. When the hardware conditions of the terminal device are more excellent, the preset retention value can be set to a smaller value, so that as few virtual objects as possible can be deleted, while ensuring the beautiful effect of the book and not affecting the smooth operation of the device. Therefore, the vegetation distribution map shown in Figure 8 can be obtained.
[0085] In some embodiments, considering that the slave virtual object may not exist independently, for example, when the slave virtual object is a bush, the initial retention value of the slave virtual object may be set to be smaller than a preset retention value.
[0086] In some embodiments, determining the retention value of each slave virtual object based on the second identifier and the third identifier specifically includes:
[0087] For each of the slave virtual objects, obtain the first number of times the slave virtual object is second-identified and the second number of times the slave virtual object is second-identified, and determine the retention value of the slave virtual object based on the first number and the second number; wherein, when the slave virtual object is second-identified once, the retention value increases by a first preset value, and when the slave virtual object is third-identified once, the retention value decreases by a second preset value.
[0088] In a specific implementation, the first preset value and the second preset value can be set as needed. Optionally, the first preset value can be set to be greater than the second preset value. For example, if a slave virtual object performs a second identification and a third identification, the retention value determined for the slave virtual object can be: the virtual object's initial retention value plus the first preset value minus the second preset value.
[0089] In some embodiments, the method further comprises:
[0090] determining a first target slave virtual object and a second target slave virtual object from the slave virtual objects in the plurality of virtual object combinations;
[0091] Performing a fourth identification on the first target slave virtual object; wherein the fourth identification is used to increase a retention value of a third preset value for the first target slave virtual object;
[0092] A fifth identification is performed on the second target from the virtual object; wherein the fourth identification is used to reduce the retention value of the second target from the virtual object by a fourth preset value.
[0093] In a specific implementation, considering that a certain type of virtual objects may need to be retained completely or as much as possible in a virtual scene, for example, collectible berry bushes, these secondary virtual objects that need to be retained can be identified as first target secondary virtual objects and a fourth identification can be applied to them, thereby increasing the retention value to retain the first target secondary virtual objects as much as possible. Similarly, considering that a certain type of virtual objects may need to be deleted completely or as much as possible in a virtual scene, these secondary virtual objects that need to be deleted can be identified as second target secondary virtual objects and a fifth identification can be applied to them, thereby decreasing the retention value to delete the second target secondary virtual objects as much as possible.
[0094] In some embodiments, the third preset value may be set to a value much larger than the preset retention value, and the fourth preset value may be set to a value much smaller than the preset retention value.
[0095] The present disclosure provides a method for rendering a virtual scene, which responds to a rendering instruction for the virtual scene and determines a rendering scheme that matches the type of the terminal device; performs a first identification on the master virtual object of the plurality of virtual object combinations according to the rendering scheme, so as to identify each master virtual object in the plurality of virtual object combinations as a first virtual object and a second virtual object, wherein different identifications are used to represent different retention tendencies; performs a second identification on each slave virtual object in the virtual object combination whose master virtual object is identified as the first virtual object, and performs a third identification on each slave virtual object in the virtual object combination whose master virtual object is identified as the second virtual object, so as to represent the retention tendency of the virtual scene; Each slave virtual object is affected by the different retention tendencies of the surrounding main virtual objects; in the terminal device, the multiple virtual object combinations in the virtual scene are rendered according to the first identifier, the second identifier and the third identifier, so that the main virtual objects and the slave virtual objects in each virtual object combination generated by rendering conform to the specified combination distribution law, thereby making it possible to delete virtual objects that do not conform to the laws of nature from the virtual scene, so that the virtual objects retained in the final virtual scene conform to the laws of nature, and improving the artistic effect of the distribution of virtual objects. At the same time, different rendering schemes can be formulated for different types of terminal devices, so that the same virtual scene can be smoothly rendered in real time in multiple hardware terminals.
[0096] It should be noted that the method of the embodiments of the present disclosure can be performed by a single device, such as a computer or server. The method of the embodiments of the present disclosure can also be applied in a distributed scenario, where multiple devices cooperate to perform the method. In such a distributed scenario, one of the multiple devices may only perform one or more steps of the method of the embodiments of the present disclosure, and the multiple devices will interact with each other to complete the method.
[0097] It should be noted that the above description is limited to some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that described in the above embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0098] Exemplary devices
[0099] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a rendering device for a virtual scene, which is applied to a terminal device, wherein the virtual scene includes multiple virtual object combinations, and each virtual object combination includes at least one main virtual object and multiple slave virtual objects configured around the main virtual object.
[0100] Referring to FIG9 , the virtual scene rendering device includes:
[0101] a determination module configured to respond to a rendering instruction for the virtual scene and determine a rendering scheme that matches the type of the terminal device;
[0102] a first identification module configured to perform a first identification on the primary virtual object of the plurality of virtual object combinations according to the rendering scheme, so as to identify each primary virtual object in the plurality of virtual object combinations as a first virtual object and a second virtual object, wherein different identifications are used to represent different retention tendencies;
[0103] a second identification module configured to perform a second identification on each slave virtual object in a virtual object group whose master virtual object is identified as the first virtual object, and to perform a third identification on each slave virtual object in a virtual object group whose master virtual object is identified as the second virtual object, so as to characterize the influence of different retention tendencies of surrounding master virtual objects on each slave virtual object in the virtual scene;
[0104] The rendering module is configured to render the multiple virtual object combinations in the virtual scene in the terminal device according to the first identifier, the second identifier and the third identifier, so that the main virtual object and the slave virtual object in each virtual object combination generated by rendering conform to the specified combination distribution law.
[0105] In some embodiments, the first identification module is specifically configured to: determine an allocation ratio of the first virtual object and the second virtual object according to the rendering scheme; and randomly perform a first identification on the main virtual object based on the allocation ratio.
[0106] In some embodiments, the first identification module is specifically configured to: determine the distribution ratio of the first virtual object and the second virtual object according to the rendering scheme; obtain the arrangement sequence number of each of the main virtual objects, and perform a first identification on the main virtual object based on the arrangement sequence number and the distribution ratio.
[0107] In some embodiments, the first identification module is specifically configured to: determine the distribution ratio of the first virtual object and the second virtual object according to the rendering scheme; determine the preset coordinate value based on the distribution ratio; obtain the target position coordinates of each of the main virtual objects in the virtual scene; and perform a first identification of the main virtual object based on the target position coordinates and the preset coordinate value.
[0108] In some embodiments, the first identification module is specifically configured to: in response to determining that the decimal point part of the target position coordinates of the main virtual object is greater than or equal to the preset coordinate value, identify the main virtual object as a first virtual object; in response to determining that the decimal point part of the target position coordinates of the main virtual object is less than the preset coordinate value, identify the main virtual object as a second virtual object.
[0109] In some embodiments, the first identification module is specifically configured to: determine the retention value of the main virtual object based on the first identification; determine the retention value of the slave virtual object based on the second identification and the third identification; delete the main virtual object and the slave virtual object whose retention value is less than the preset retention value from the multiple virtual object combinations in the virtual scene to complete the rendering in the virtual scene; wherein, the preset retention value is determined by the hardware conditions of the terminal device.
[0110] In some embodiments, the first identification module is specifically configured to: for each of the slave virtual objects, obtain the first number of times the slave virtual object is second-identified and the second number of times the slave virtual object is second-identified, and determine the retention value of the slave virtual object based on the first number and the second number; wherein, the retention value of the slave virtual object is increased by a first preset value when the slave virtual object is second-identified once, and the retention value of the slave virtual object is reduced by a second preset value when the slave virtual object is third-identified once.
[0111] In some embodiments, the device also includes a third identification module, which is configured to: determine a first target from virtual object and a second target from virtual object from the multiple virtual object combinations; perform a fourth identification on the first target from virtual object; wherein the fourth identification is used to increase the retention value of the first target from virtual object by a third preset value; perform a fifth identification on the second target from virtual object; wherein the fourth identification is used to reduce the retention value of the second target from virtual object by a fourth preset value.
[0112] For the convenience of description, the above devices are described as being functionally divided into various modules. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0113] The device of the above embodiment is used to implement the corresponding virtual scene rendering method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0114] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the program, the virtual scene rendering method described in any of the above embodiments is implemented.
[0115] FIG10 shows a more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are communicatively connected to each other within the device via the bus 1050.
[0116] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0117] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage devices, dynamic storage devices, etc. The memory 1020 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.
[0118] The input / output interface 1030 is used to connect input / output modules to implement information input and output. The input / output modules can be configured as components within the device (not shown in the figure) or can be externally connected to the device to provide corresponding functions. Input devices may include a keyboard, mouse, touch screen, microphone, various sensors, etc., and output devices may include a display, speaker, vibrator, indicator light, etc.
[0119] The communication interface 1040 is used to connect to a communication module (not shown) to enable communication between the device and other devices. The communication module can communicate via a wired method (such as USB, network cable, etc.) or a wireless method (such as mobile network, WiFi, Bluetooth, etc.).
[0120] The bus 1050 comprises a path for transmitting information between the various components of the device (eg, the processor 1010 , the memory 1020 , the input / output interface 1030 , and the communication interface 1040 ).
[0121] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, it will be understood by those skilled in the art that the above device may only include the components necessary to implement the embodiments of this specification, and does not necessarily include all the components shown in the figure.
[0122] The electronic device of the above embodiment is used to implement the corresponding virtual scene rendering method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0123] The memory 1020 stores machine-readable instructions executable by the processor 1010. When the electronic device is running, the processor 1010 communicates with the memory 1020 via the bus 1050, so that the processor 1010 executes the following instructions when running: responding to a rendering instruction for the virtual scene, determining a rendering scheme that matches the type of the terminal device; performing a first identification on the master virtual object of the multiple virtual object combinations according to the rendering scheme, so as to identify each master virtual object in the multiple virtual object combinations as a first virtual object and a second virtual object, wherein different identifications are used to represent different retention tendencies; performing a second identification on each slave virtual object in the virtual object combination whose master virtual object is identified as the first virtual object, and performing a third identification on each slave virtual object in the virtual object combination whose master virtual object is identified as the second virtual object, so as to represent the influence of the different retention tendencies of the surrounding master virtual objects on each slave virtual object in the virtual scene; and rendering the multiple virtual object combinations in the virtual scene in the terminal device according to the first identification, the second identification, and the third identification, so that the master virtual object and the slave virtual object in each virtual object combination generated by rendering conform to a specified combination distribution pattern.
[0124] In one possible implementation, the instructions executed by the processor 1010 perform a first identification on the main virtual object of the combination of multiple virtual objects according to the rendering scheme, specifically including: determining an allocation ratio of the first virtual object and the second virtual object according to the rendering scheme; and randomly performing a first identification on the main virtual object based on the allocation ratio.
[0125] In one possible implementation, the instructions executed by the processor 1010 perform a first identification on the main virtual object of the combination of the multiple virtual objects according to the rendering scheme, specifically including: determining the allocation ratio of the first virtual object and the second virtual object according to the rendering scheme; obtaining the arrangement sequence number of each of the main virtual objects, and performing a first identification on the main virtual object based on the arrangement sequence number and the allocation ratio.
[0126] In one possible embodiment, in the instructions executed by the processor 1010, the main virtual object of the combination of the multiple virtual objects is first identified according to the rendering scheme, specifically including: determining the distribution ratio of the first virtual object and the second virtual object according to the rendering scheme; determining a preset coordinate value based on the distribution ratio; obtaining the target position coordinates of each of the main virtual objects in the virtual scene; and first identifying the main virtual object based on the target position coordinates and the preset coordinate value.
[0127] In one possible embodiment, in the instructions executed by the processor 1010, the main virtual object is first identified based on the target position coordinates and the preset coordinate value, specifically including: in response to determining that the decimal point part of the target position coordinates of the main virtual object is greater than or equal to the preset coordinate value, identifying the main virtual object as a first virtual object; in response to determining that the decimal point part of the target position coordinates of the main virtual object is less than the preset coordinate value, identifying the main virtual object as a second virtual object.
[0128] In one possible embodiment, in the instructions executed by the processor 1010, the multiple virtual object combinations in the virtual scene are rendered in the terminal device according to the first identifier, the second identifier and the third identifier, specifically including: determining the retention value of the main virtual object based on the first identifier; determining the retention value of the slave virtual object based on the second identifier and the third identifier; deleting the main virtual object and the slave virtual object whose retention value is less than the preset retention value from the multiple virtual object combinations in the virtual scene to complete the rendering in the virtual scene; wherein the preset retention value is determined by the hardware conditions of the terminal device.
[0129] In a possible embodiment, the instructions executed by the processor 1010 determine the retention value of each of the slave virtual objects based on the second identification and the third identification, specifically including: for each of the slave virtual objects, obtaining the first number of times the slave virtual object is second-identified and the second number of times the slave virtual object is second-identified, and determining the retention value of the slave virtual object based on the first number and the second number; wherein, the retention value of the slave virtual object increases by a first preset value when the slave virtual object is second-identified once, and the retention value of the slave virtual object decreases by a second preset value when the slave virtual object is third-identified once.
[0130] In one possible embodiment, in the instructions executed by the processor 1010, the method further includes: determining a first target slave virtual object and a second target slave virtual object from the slave virtual objects in the multiple virtual object combinations; performing a fourth identification on the first target slave virtual object; wherein the fourth identification is used to increase the retention value of the first target slave virtual object by a third preset value; and performing a fifth identification on the second target slave virtual object; wherein the fourth identification is used to reduce the retention value of the second target slave virtual object by a fourth preset value.
[0131] In the above manner, when the electronic device is running, it responds to a rendering instruction for the virtual scene and determines a rendering scheme that matches the type of the terminal device; performs a first identification on the main virtual object of the plurality of virtual object combinations according to the rendering scheme, so as to identify each main virtual object in the plurality of virtual object combinations as a first virtual object and a second virtual object, wherein different identifications are used to represent different retention tendencies; performs a second identification on each slave virtual object in the virtual object combination whose main virtual object is identified as the first virtual object, and performs a third identification on each slave virtual object in the virtual object combination whose main virtual object is identified as the second virtual object, so as to represent the retention tendencies in the virtual scene. Each slave virtual object is affected by the different retention tendencies of the surrounding main virtual objects; in the terminal device, the multiple virtual object combinations in the virtual scene are rendered according to the first identifier, the second identifier and the third identifier, so that the main virtual objects and the slave virtual objects in each virtual object combination generated by rendering conform to the specified combination distribution law, thereby making it possible to delete virtual objects that do not conform to the laws of nature from the virtual scene, so that the virtual objects retained in the final virtual scene conform to the laws of nature, and improving the artistic effect of the distribution of virtual objects. At the same time, different rendering schemes can be formulated for different types of terminal devices, so that the same virtual scene can be smoothly rendered in real time in multiple hardware terminals.
[0132] Exemplary Program Products
[0133] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the virtual scene rendering method described in any of the above embodiments.
[0134] The computer-readable media of this embodiment include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0135] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the virtual scene rendering method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0136] Based on the same inventive concept, corresponding to any of the above-described embodiments and methods, the present disclosure further provides a computer program product comprising a computer program. In some embodiments, the computer program instructions can be executed by one or more processors of a computer to cause the computer and / or the processor to perform the virtual scene rendering method described in the above-described embodiments. For the execution entities corresponding to the steps in each embodiment of the scene editing method, the processors executing the corresponding steps can belong to the corresponding execution entities.
[0137] The computer program product of the above embodiment is used to enable the computer and / or the processor to execute the virtual scene rendering method described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0138] It is understandable that before using the technical solutions of each embodiment of the present disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved will be informed to the user in an appropriate manner, and the user's authorization will be obtained.
[0139] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operation of the disclosed technical solution based on the prompt message.
[0140] As an optional but non-limiting implementation, in response to a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0141] It is understandable that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0142] It will be understood by those skilled in the art that the embodiments of the present disclosure may be implemented as a system, method, or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." In addition, in some embodiments, the present disclosure may also be implemented in the form of a computer program product in one or more computer-readable media, wherein the computer-readable medium contains computer-readable program code.
[0143] Any combination of one or more computer-readable media can be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (non-exhaustive examples) of computer-readable storage media can include, for example: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.
[0144] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0145] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0146] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0147] It should be understood that each block in the flowchart and / or block diagram, and combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine. These computer program instructions are executed by the computer or other programmable data processing device to produce a device that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.
[0148] These computer program instructions can also be stored in a computer-readable medium that enables a computer or other programmable data processing device to operate in a specific manner. In this way, the instructions stored in the computer-readable medium produce a product that includes an instruction device that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.
[0149] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, such that the instructions executed on the computer or other programmable apparatus provide a process that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.
[0150] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. Each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the boxes can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0151] It should be noted that although several modules or units of the device for action execution are mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0152] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Within the scope of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of simplicity.
[0153] In addition, to simplify the description and discussion, and so as not to obscure the embodiments of the present disclosure, known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, devices may be shown in the form of block diagrams to avoid obscuring the embodiments of the present disclosure, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure are to be implemented (i.e., these details should be fully within the purview of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it will be apparent to those skilled in the art that the embodiments of the present disclosure may be implemented without these specific details or with variations in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0154] Although the present disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those skilled in the art based on the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0155] The embodiments of the present disclosure are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present disclosure should be included in the scope of protection of the present disclosure.
Claims
1. A method for rendering a virtual scene, applied to a terminal device, wherein the virtual scene includes a plurality of virtual object combinations, each virtual object combination including at least one master virtual object and a plurality of slave virtual objects arranged around the master virtual object; the method comprising: In response to a rendering instruction for the virtual scene, determining a rendering scheme that matches the type of the terminal device; performing a first identification on the main virtual object of the plurality of virtual object combinations according to the rendering scheme, so as to identify each main virtual object in the plurality of virtual object combinations as a first virtual object and a second virtual object, wherein different identifications are used to represent different retention tendencies; performing a second identification on each slave virtual object within a virtual object group whose master virtual object is identified as the first virtual object, and performing a third identification on each slave virtual object within a virtual object group whose master virtual object is identified as the second virtual object, to characterize the influence of different retention tendencies of surrounding master virtual objects on each slave virtual object in the virtual scene; The plurality of virtual object combinations in the virtual scene are rendered in the terminal device according to the first identifier, the second identifier, and the third identifier, so that the master virtual object and the slave virtual object in each virtual object combination generated by rendering conform to a specified combination distribution rule.
2. The method according to claim 1, wherein Performing a first identification on the main virtual object of the combination of the multiple virtual objects according to the rendering scheme specifically includes: determining a distribution ratio of the first virtual object and the second virtual object according to the rendering scheme; The primary virtual object is randomly first identified based on the allocation ratio.
3. The method according to claim 1, wherein Performing a first identification on the main virtual object of the combination of the multiple virtual objects according to the rendering scheme specifically includes: determining a distribution ratio of the first virtual object and the second virtual object according to the rendering scheme; Acquire an arrangement sequence number of each of the primary virtual objects, and perform a first identification on the primary virtual object based on the arrangement sequence number and the allocation ratio.
4. The method according to claim 1, wherein Performing a first identification on the main virtual object of the combination of the multiple virtual objects according to the rendering scheme specifically includes: determining a distribution ratio of the first virtual object and the second virtual object according to the rendering scheme; Determining preset coordinate values based on the allocation ratio; Obtaining target position coordinates of each of the primary virtual objects in the virtual scene; The main virtual object is first identified based on the target position coordinates and the preset coordinate values.
5. The method according to claim 4, wherein The method further includes: performing a first identification on the primary virtual object based on the target position coordinates and the preset coordinate values; In response to determining that the decimal point portion of the target position coordinates of the primary virtual object is greater than or equal to the preset coordinate value, identifying the primary virtual object as a first virtual object; In response to determining that the decimal point portion of the target position coordinates of the main virtual object is smaller than the preset coordinate value, the main virtual object is identified as a second virtual object.
6. The method according to claim 4, wherein: Rendering the plurality of virtual object combinations in the virtual scene according to the first identifier, the second identifier, and the third identifier in the terminal device specifically includes: determining a retention value of the primary virtual object based on the first identifier; determining a retention value of the slave virtual object based on the second identifier and the third identifier; The main virtual object and the slave virtual object whose retention value is less than the preset retention value are deleted from the multiple virtual object combinations in the virtual scene to complete the rendering in the virtual scene; wherein, the preset retention value is determined by the hardware conditions of the terminal device.
7. The method according to claim 6, wherein: Determining the retention value of each slave virtual object based on the second identifier and the third identifier specifically includes: For each of the slave virtual objects, obtain the first number of times the slave virtual object is second-identified and the second number of times the slave virtual object is second-identified, and determine the retention value of the slave virtual object based on the first number and the second number; wherein, when the slave virtual object is second-identified once, the retention value increases by a first preset value, and when the slave virtual object is third-identified once, the retention value decreases by a second preset value.
8. The method according to claim 1, wherein The method further comprises: determining a first target slave virtual object and a second target slave virtual object from the slave virtual objects in the plurality of virtual object combinations; Performing a fourth identification on the first target slave virtual object; wherein the fourth identification is used to increase a retention value of a third preset value for the first target slave virtual object; A fifth identification is performed on the second target from the virtual object; wherein the fourth identification is used to reduce the retention value of the second target from the virtual object by a fourth preset value.
9. A virtual scene rendering device, applied to a terminal device, wherein the virtual scene includes a plurality of virtual object combinations, each virtual object combination including at least one master virtual object and a plurality of slave virtual objects arranged around the master virtual object; the device comprising: a determination module configured to respond to a rendering instruction for the virtual scene and determine a rendering scheme that matches the type of the terminal device; a first identification module configured to perform a first identification on the primary virtual object of the plurality of virtual object combinations according to the rendering scheme, so as to identify each primary virtual object in the plurality of virtual object combinations as a first virtual object and a second virtual object, wherein different identifications are used to represent different retention tendencies; a second identification module configured to perform a second identification on each slave virtual object in a virtual object group whose master virtual object is identified as the first virtual object, and to perform a third identification on each slave virtual object in a virtual object group whose master virtual object is identified as the second virtual object, so as to characterize the influence of different retention tendencies of surrounding master virtual objects on each slave virtual object in the virtual scene; The rendering module is configured to render the multiple virtual object combinations in the virtual scene in the terminal device according to the first identifier, the second identifier and the third identifier, so that the main virtual object and the slave virtual object in each virtual object combination generated by rendering conform to the specified combination distribution law.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method according to any one of claims 1 to 8 when executing the program. 11 . A non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the method according to claim 1 .
Citation Information
Patent Citations
Virtual vegetation rendering method and device, storage medium and electronic equipment
CN110288688A
Vegetation generation method and device in virtual scene and electronic equipment
CN115518374A
Virtual ground processing method and device, storage medium and electronic equipment
CN116993883A
Virtual scene rendering method and device, electronic equipment and storage medium
CN117919704A
Image generating method, recording medium, image generator, and program
JP2003141560A