CN111008934B - Scene construction method, device, equipment and storage medium - Google Patents

Scene construction method, device, equipment and storage medium Download PDF

Info

Publication number
CN111008934B
CN111008934B CN201911356104.5A CN201911356104A CN111008934B CN 111008934 B CN111008934 B CN 111008934B CN 201911356104 A CN201911356104 A CN 201911356104A CN 111008934 B CN111008934 B CN 111008934B
Authority
CN
China
Prior art keywords
original
picture
picture set
target
scene
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911356104.5A
Other languages
Chinese (zh)
Other versions
CN111008934A (en
Inventor
程思鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Mihoyo Tianming Technology Co Ltd
Original Assignee
Shanghai Mihoyo Tianming Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Mihoyo Tianming Technology Co Ltd filed Critical Shanghai Mihoyo Tianming Technology Co Ltd
Priority to CN201911356104.5A priority Critical patent/CN111008934B/en
Publication of CN111008934A publication Critical patent/CN111008934A/en
Application granted granted Critical
Publication of CN111008934B publication Critical patent/CN111008934B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4023Scaling of whole images or parts thereof, e.g. expanding or contracting based on decimating pixels or lines of pixels; based on inserting pixels or lines of pixels
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the invention discloses a scene construction method, a device, equipment and a storage medium, wherein the scene construction method comprises the following steps: mapping an original picture set corresponding to each scene rendering component onto a target picture set, wherein the original picture set is a picture set for constructing an original scene, and the target picture set is a picture set obtained by scaling the original picture set; based on the original picture set and the target picture set, adjusting the original scaling of the corresponding scene rendering assembly to obtain the target scaling of each scene rendering assembly; the original scene is constructed based on the target scale and the target picture set. The technical scheme of the embodiment of the invention achieves the effect of simply and quickly constructing the original scene after the resolution of the image is changed.

Description

Scene construction method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of image processing, in particular to a scene construction method, a device, equipment and a storage medium.
Background
Now, the unit 2d game scene is built by mostly using a SpriteRender scene rendering component, a single picture resource is usually led in the process of building the scene by using the component, the SpriteRender component is added in the scene, the size of the component is manually adjusted, and the size of the component needs to be manually adjusted once when one picture resource is led in. In addition, for each picture resource, after the component size is determined, if the picture size is changed, the component size used for the picture in the scene needs to be manually adjusted once again.
The size of the SpriteRender component in the scene is related to the resolution of the picture resources, and after the scene is built, if the resolution of the original picture resources is modified, the size of the SpriteRender component in the scene is changed, so that the size of the related objects of the scene needs to be manually adjusted, and the process consumes a great deal of manpower and time.
Disclosure of Invention
The invention provides a scene construction method, device, equipment and storage medium, which can simply and quickly construct an original scene after the resolution of an image is changed.
In a first aspect, an embodiment of the present invention provides a scene construction method, where the method includes:
mapping an original picture set corresponding to each scene rendering component onto a target picture set, wherein the original picture set is a picture set for constructing an original scene, and the target picture set is a picture set obtained by scaling the original picture set;
based on the original picture set and the target picture set, adjusting the original scaling of the corresponding scene rendering assembly to obtain the target scaling of each scene rendering assembly;
and constructing the original scene based on the target scaling and the target picture set.
In a second aspect, an embodiment of the present invention further provides a scene construction apparatus, where the apparatus includes:
the mapping module is used for mapping an original picture set corresponding to each scene rendering component onto a target picture set, wherein the original picture set is a picture set for constructing an original scene, and the target picture set is a picture set obtained by scaling the original picture set;
the scaling adjustment module is used for adjusting the original scaling of the corresponding scene rendering assembly based on the original picture set and the target picture set to obtain the target scaling of each scene rendering assembly;
and the original scene construction module is used for constructing the original scene based on the target scaling and the target picture set.
In a third aspect, an embodiment of the present invention further provides a computer apparatus, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the scene building method according to any of the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention further provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a scene construction method according to any of the embodiments of the present invention.
According to the embodiment of the invention, the original picture set corresponding to each scene rendering component is mapped to the target picture set, wherein the original picture set is the picture set for constructing the original scene, and the target picture set is the picture set obtained by scaling the original picture set; based on the original picture set and the target picture set, adjusting the original scaling of the corresponding scene rendering assembly to obtain the target scaling of each scene rendering assembly; the original scene is constructed based on the target scaling and the target picture set, the defect that the size of a scene rendering component in the scene is changed if the original picture resource resolution is modified when the scene is constructed, so that the sizes of objects related to the scene are required to be adjusted is overcome, and the effect that the original scene can be simply and quickly constructed after the image resolution is changed is achieved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description will be given below of the drawings required for the embodiments or the prior art descriptions, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a scene construction method according to a first embodiment of the present invention;
FIG. 2 is a flow chart of a scene construction method in a second embodiment of the invention;
FIG. 3 is a schematic structural diagram of a scene building apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device in a fourth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a flowchart of a scene construction method according to a first embodiment of the present invention, where the method may be implemented by a scene construction device, the device may be implemented in software and/or hardware, and the device may be configured in a computer device. As shown in fig. 1, the method specifically may include the following steps:
S110, mapping an original picture set corresponding to each scene rendering component onto a target picture set, wherein the original picture set is a picture set for constructing an original scene, and the target picture set is a picture set obtained by scaling the original picture set.
Scene design and construction are typically involved in game software production or movie and television special effects production. In the course of scene design and construction, it is common to apply to scene rendering components and to the collection of pictures used to construct a scene. Taking the example of building a scene in game software, the scene rendering component may preferably be SpriteRenderer applied in the Unity game engine. In this embodiment, the original picture set may be a picture set for constructing an original scene, and each picture in the original picture set may correspond to one scene rendering component. In constructing the original scene, each scene rendering component may determine its own size (or a scaling of the original picture) according to an actual size of the original picture and a display size of the original picture in the scene, and adjust the display size of the original picture in the scene according to its own size, so that the original picture can be normally displayed in the scene.
Generally, after the original scene is built by using the original picture set and the corresponding scene rendering component, if the size of at least one original picture in the original picture set is changed, but the size of the scene rendering component is not changed, at this time, the original scene cannot be built according to the original picture set and the scene rendering component after the size is changed.
In this embodiment, after the original picture set and the corresponding scene rendering components are utilized to complete the construction of the original scene, and the scaling process is performed on the original picture set (where the scaling process may include compression process and amplification process, and the scaling process is performed on the original picture set, that is, the size of at least one original picture in the original picture set is changed), to obtain the target picture set, the original picture set corresponding to each scene rendering component may be preferably mapped onto the target picture set, that is, the target picture set is utilized to replace the original picture set. Preferably, mapping the original picture set corresponding to each scene rendering component onto the target picture set may include mapping a storage path of each original picture in the original picture set corresponding to each scene rendering component onto a storage path of each target picture in the target picture set.
It should be noted that, the scaling processing of the original picture set may be that a part of original pictures in the original picture set is scaled, while other original pictures in the original picture set are not scaled. It is also possible to scale all original pictures in the original picture set. The specific scaling method may be set according to actual needs, and is not limited herein.
S120, adjusting the original scaling of the corresponding scene rendering assembly based on the original picture set and the target picture set to obtain the target scaling of each scene rendering assembly.
For each original picture in the original picture set, if the target picture corresponding to the original picture set is the target picture after scaling, the display size of the original picture in the original scene can be determined according to the size of the original picture and the original scaling of the scene rendering assembly, the target scaling of the scene rendering assembly corresponding to the original picture is determined according to the display size of the original picture in the original scene and the size of the target picture, and the original scaling of the scene rendering assembly is adjusted to be the target scaling. If the target picture corresponding to the target picture is an original picture which is not scaled, the target scale may be determined to be the original scale, and in this case, the original scale may be preferably used as the target scale. In this embodiment, the target scaling of each scene rendering component may be preferably determined according to the method for determining the target scaling of the scene rendering component described above.
S130, constructing an original scene based on the target scaling and the target picture set.
In this embodiment, for each target picture in the target picture set, the size of the target picture in the corresponding original scene may be determined preferably by using the target scaling of the target picture and the scene rendering component corresponding to the target picture, and then the entire original scene may be constructed by using the target picture set.
It should be noted that, before mapping the original picture set corresponding to each scene rendering component onto the target picture set, copying the original scene may preferably be further included. After the original scene is constructed based on the target scaling and the target picture set, the original scene is compared with the reconstructed original scene by using the copied original scene to determine whether the reconstructed original scene is correct.
According to the scene construction method provided by the embodiment, the original picture set corresponding to each scene rendering component is mapped to the target picture set, wherein the original picture set is the picture set for constructing the original scene, and the target picture set is the picture set obtained by scaling the original picture set; based on the original picture set and the target picture set, adjusting the original scaling of the corresponding scene rendering assembly to obtain the target scaling of each scene rendering assembly; the original scene is constructed based on the target scaling and the target picture set, the defect that the size of a scene rendering component in the scene is changed if the original picture resource resolution is modified when the scene is constructed, so that the sizes of objects related to the scene are required to be adjusted is overcome, and the effect that the original scene can be simply and quickly constructed after the image resolution is changed is achieved.
On the basis of the above embodiments, further, scaling the original picture set includes:
and compressing the original picture set based on a preset compression rule to obtain a target picture set.
In this embodiment, the compressing of the original picture set may be compressing a part of original pictures in the original picture set, while other original pictures in the original picture set are not compressed. Or compressing all original pictures in the original picture set. The specific compression method may be set according to actual needs, and is not particularly limited herein.
For example, based on a preset compression rule, compressing the original picture set may include determining an original picture in the original picture set having a size exceeding a first preset size, and compressing the size of the original picture having the size exceeding the first preset size to the first preset size. The compressing the original picture set based on the preset compression rule may also include determining an original picture having a size within a preset size range in the original picture set, and compressing the size of the original picture having the size within the preset size range to a second preset size. The compressing the original picture set based on the preset compression rule may also include compressing each original picture in the original picture set based on a preset compression ratio. The compressing the original picture set based on the preset compression rule may further include compressing a size of each original picture in the original picture set to a third preset size.
It should be noted that, the target pictures in the target picture set may correspond to the compressed original pictures one by one, or may be formed by splicing at least two compressed original pictures.
On the basis of the above embodiments, further, based on a preset compression rule, performing compression processing on the original picture set to obtain a target picture set, including:
determining the size of each original picture in the original picture set;
if the width of the first original picture is larger than the first preset size, compressing the width of the first original picture to the first preset size, and carrying out equal-proportion compression on the height of the first original picture to obtain a first target picture;
and/or if the height of the second original picture is larger than the first preset size, compressing the height of the second original picture to the first preset size, and compressing the width of the second original picture in equal proportion to obtain a second target picture;
and/or if the height and the width of the second original picture are larger than the first preset size, compressing the height to the first preset size and compressing the width in equal proportion to obtain a third target picture if the height is larger than the width; if the width is larger than the height, compressing the width to a first preset size, and compressing the height in equal proportion to obtain a fourth target picture;
And forming a target picture set by at least one of the first target picture, the second target picture, the third target picture and the fourth target picture and a third original picture, wherein the third original picture is an uncompressed original picture in the original picture set.
Taking the original scene as the scene in the hand tour, the first preset size is 2048pix (since the mobile phone terminal displays the pictures with the size larger than 2048pix possibly with errors, and the pictures with the size larger than 2048pix occupy a larger storage space, the 2048pix can be preferably used as the first preset size), and the steps are specifically described as follows:
by determining the size of each original picture in the original picture set, it is possible to determine that 1 original picture having a width of 3072pix and a height of 512pix, 1 original picture having a height of 2560pix and a width of 1024pix, 1 original picture having a width of 2560pix and a height of 3072pix, 1 original picture having a height of 2560pix and a width of 3072pix, and 96 original pictures having a width and a length of each less than or equal to 2048pix are included in the original pictures. According to a first preset size 2048pix, compressing the original picture with the width of 3072pix and the height of 512pix to 2048pix, and compressing the corresponding width to (2048/3072) ×512=341 pix to obtain a first target picture with the width of 2048pix and the height of 341 pix. The original picture with a height of 2560pix and a width of 1024pix is compressed to 2048pix, and the corresponding width is compressed to (2048/2560) ×1024=819 pix, resulting in a second target picture with a height of 2048pix and a height of 819 pix. The original picture with width 2560pix and height 3072pix is compressed to 2048pix and the corresponding width is compressed to (2048/3072) ×2560=1707pix, resulting in a third target picture with height 2048pix and width 1707 pix. The original picture with a height of 2560pix and a width of 3072pix is compressed to 2048pix, and the corresponding height is compressed to (2048/3072) ×2560=1707pix, resulting in a fourth target picture with a width of 2048pix and a height of 1707 pix. A first target picture having a width of 2048pix and a height of 341pix, a second target picture having a height of 2048pix and a height of 819pix, a third target picture having a height of 2048pix and a width of 1707pix, a fourth target picture having a width of 2048pix and a height of 1707pix, and 96 original pictures each having a width and a length of less than or equal to 2048pix are taken as a target picture set.
Example two
Fig. 2 is a flowchart of a scene construction method according to a second embodiment of the present invention. This embodiment may be combined with each of the alternatives of one or more of the embodiments described above, which, in this embodiment,
before mapping the original picture set corresponding to each scene rendering component onto the target picture set, the method further comprises:
compressing the original picture set to obtain compressed pictures corresponding to each original picture;
determining a first compressed picture set forming each target picture, wherein the corresponding sizes of the width and the height of the target pictures are second preset sizes;
and splicing the first compressed pictures in each first compressed picture set into a target picture by using an image splicing algorithm to obtain the target picture set.
As shown in fig. 2, the method in this embodiment specifically includes:
s210, compressing the original picture set based on a preset compression rule to obtain compressed pictures corresponding to each original picture.
The process of compressing the original picture set based on the preset compression rule is the same as the process of compressing the original picture set based on the preset compression rule, and will not be described herein.
S220, determining a first compressed picture set forming each target picture, wherein the sizes corresponding to the width and the height of the target picture are both second preset sizes.
And S230, splicing the first compressed pictures in each first compressed picture set into target pictures by using an image splicing algorithm to obtain target picture sets.
Taking game software as an example, in general, if each target picture in the target picture set is stored in a form of a scattered picture (i.e., the target picture corresponds to the compressed picture one by one), the game engine cannot perform drawcall merging during the game running process, which results in low game running efficiency. Based on the above-mentioned shortcomings, in this embodiment, at least one scatter plot is preferably spliced into an atlas (an atlas is a target picture in this embodiment) according to a preset picture size, so as to improve the game running efficiency through drawcall merging in the game running process.
Preferably, the first compressed picture set may include at least one compressed picture, where the width and the height of each compressed picture are not greater than the second preset size. Because the compressed pictures are different in size, it can be understood that the compressed pictures in the first predetermined compressed picture set may not be able to fill the whole target picture, and at this time, a blank portion exists in the obtained target picture.
In this embodiment, the second preset size may be determined according to actual needs, and, for example, if the original scene is a scene in a hand tour, the second preset size may be 2048pix. The first compressed picture set may preferably be formed by selecting an appropriate compressed picture by textureplacker and stitching the target picture in a pattern of Polygon. After the target picture set is obtained, the target picture may preferably be stored in a preset storage location for game runtime invocation.
S240, mapping an original picture set corresponding to each scene rendering component onto a target picture set, wherein the original picture set is a picture set for constructing an original scene, and the target picture set is a picture set obtained by scaling the original picture set.
Here, since the target picture in the target picture set is generated by the first compressed picture set, it may be preferable to map the storage path of each original picture corresponding to the first compressed picture set onto the same storage path of the target picture generated by the first compressed picture set in the mapping process. It will be appreciated that although the storage paths of the mappings are the same, the location of each original picture mapping onto the target picture is different.
S250, adjusting original scaling of the corresponding scene rendering components based on the original picture set and the target picture set to obtain target scaling of each scene rendering component.
S260, constructing an original scene based on the target scaling and the target picture set.
According to the scene construction method provided by the embodiment, compression processing is carried out on an original picture set based on a preset compression rule, so that compressed pictures corresponding to each original picture are obtained; determining a first compressed picture set forming each target picture, wherein the sizes corresponding to the width and the height of the target picture are both second preset sizes; and splicing the first compressed pictures in each first compressed picture set into a target picture by using an image splicing algorithm to obtain a target picture set. Mapping an original picture set corresponding to each scene rendering component onto a target picture set, wherein the original picture set is a picture set for constructing an original scene, and the target picture set is a picture set obtained by scaling the original picture set; based on the original picture set and the target picture set, adjusting the original scaling of the corresponding scene rendering assembly to obtain the target scaling of each scene rendering assembly; the method has the advantages that the original scene is built based on the target scaling and the target picture set, the defect that when the scene is built, if the original picture resource resolution is modified, the size of a scene rendering component in the scene is changed, and therefore the sizes of objects related to the scene are required to be adjusted is overcome, the effect that the original scene can be built simply and quickly after the image resolution is changed is achieved, meanwhile, the running efficiency of application software can be improved, and meanwhile, the size of packed data is reduced by splicing a plurality of compressed pictures into the target picture (picture set).
On the basis of the above embodiments, further, after each compressed picture in the compressed picture set is spliced into the target picture by using the image stitching algorithm, the method further includes:
determining whether the target picture set contains all compressed pictures;
if not, determining a second compressed picture which is not contained in the target picture set;
a first set of target pictures is generated based on the second compressed picture and the first set of target pictures is added to the set of target pictures.
Since the original scene needs to be built by using the target picture set, in order to restore the original scene, it is necessary to ensure that all compressed pictures corresponding to the original pictures one by one are included in the target picture set. If it is determined that there is a missing second compressed picture, a first target picture set may be generated based on the second compressed picture according to the scheme of determining a target picture using the first compressed picture set in the present embodiment, where the first target picture set includes at least one target picture generated from the second compressed picture.
Preferably, after determining that the missing compressed picture exists in the target picture set, generating feedback information may be further included, where the feedback information may include prompt information of the missing compressed picture, and may further include unique information for determining the missing compressed picture, for example, may be a name of the compressed picture, and the like.
On the basis of the above embodiments, further, after each compressed picture in the compressed picture set is spliced into the target picture by using the image stitching algorithm, the method further includes:
determining whether the target picture set contains repeated third compressed pictures;
and if so, deleting the repeated third compressed picture in the corresponding target picture.
Preferably, whether the target picture set contains the repeated third compressed picture may be determined by comparing every two target pictures.
On the basis of the above embodiments, further, after each compressed picture in the compressed picture set is spliced into the target picture by using the image stitching algorithm, the method further includes:
determining a configuration file of the target picture set, wherein the configuration file comprises a compression mode of the target picture set, and the compression mode corresponds to an application platform of the target picture set.
For example, if the application platform is IOS, the compression method may be set to ASTC6 x 6, and if the application platform is android, the compression method may be set to ETC2.
Taking the original scene as the scene in the hand tour, the first preset size is 2048 as an example, and the steps in the embodiment are specifically described:
Copying the original picture set into a folder for compression processing, and classifying the original pictures in the folder according to the sizes of the original pictures, wherein the specific classification result can comprise: original pictures with a width exceeding 2048pix, original pictures with a height exceeding 2048pix, original pictures with a width and a height exceeding 2048pix, original pictures with a width or a height exceeding 512pix, and original pictures with a width and a height of 512pix and below 2048 pix. Based on a preset compression rule, performing compression processing on an original picture with a width exceeding 2048pix, an original picture with a height exceeding 2048pix and an original picture with a width and a height exceeding 2048pix in an original picture set to obtain compressed pictures corresponding to each original picture, wherein the compressed pictures can comprise a first target picture with a width of 2048pix and a height of 341pix, a second target picture with a height of 2048pix and a height of 819pix, a third target picture with a height of 2048pix and a width of 1707pix, a fourth target picture with a width of 2048pix and a height of 1707pix and 96 original pictures with a width and a length of less than or equal to 2048 pix.
And selecting proper compressed pictures from the compressed pictures by using a textureplacker to form a first compressed picture set, splicing the compressed pictures in the first compressed picture set into target pictures in a Polygon mode, and outputting the obtained target pictures to a preset storage folder so as to be called when the game is run.
Determining whether all compressed pictures are contained in the preset storage folder or not, determining whether a repeated third compressed picture is contained in the preset storage folder or not, if the missing compressed pictures are determined, generating target pictures by using the missing compressed pictures, and storing the target pictures into the preset storage folder. If it is determined that there are duplicate compressed pictures, the duplicate compressed pictures are deleted.
After the above processing is completed, determining the configuration file of the target picture set in the preset storage folder and the corresponding compression mode. If the application platform where the hand tour is located is android, the compression mode may be set to be ETC2.
Mapping the storage path of each original picture in the original picture set corresponding to each scene rendering component to the storage path of the corresponding target picture in the preset storage folder, and determining the position of each original picture in the corresponding target picture. According to the size of the original picture and the size of the corresponding position of the target picture, the original scaling of the corresponding scene rendering assembly is adjusted, the target scaling of each scene rendering assembly is obtained, and the original scene is constructed based on the target scaling and the target picture set.
Example III
Fig. 3 is a schematic structural diagram of a scene building apparatus according to a third embodiment of the present invention. As shown in fig. 3, the apparatus of this embodiment includes:
the mapping module 310 is configured to map an original picture set corresponding to each scene rendering component onto a target picture set, where the original picture set is a picture set for constructing an original scene, and the target picture set is a picture set obtained by scaling the original picture set;
the scaling adjustment module 320 is configured to adjust an original scaling of a corresponding scene rendering component based on the original picture set and the target picture set, to obtain a target scaling of each scene rendering component;
the original scene construction module 330 is configured to construct an original scene based on the target scaling and the target picture set.
According to the scene construction device provided by the embodiment, the original picture set corresponding to each scene rendering component is mapped onto the target picture set by utilizing the mapping module, wherein the original picture set is the picture set for constructing the original scene, and the target picture set is the picture set obtained by scaling the original picture set; adjusting the original scaling of the corresponding scene rendering assembly based on the original picture set and the target picture set by utilizing a scaling adjustment module to obtain the target scaling of each scene rendering assembly; the original scene is constructed by the original scene construction module based on the target scaling and the target picture set, so that the defect that the size of a scene rendering component in a scene is changed if the original picture resource resolution is modified when the scene is constructed is overcome, and the sizes of objects related to the scene are required to be adjusted is overcome, and the effect that the original scene can be simply and quickly constructed after the image resolution is changed is achieved.
Based on the above technical solutions, optionally, the mapping module 310 may specifically include:
the first compression unit is used for compressing the original picture set based on a preset compression rule to obtain a target picture set.
Based on the above technical solutions, optionally, the first compression unit may specifically include:
a size determining subunit, configured to determine a size of each original picture in the original picture set;
the first target picture determining subunit is used for compressing the width to a first preset size if the width of the first original picture is larger than the first preset size, and performing equal-proportion compression on the height of the first original picture to obtain a first target picture;
and/or a second target picture determining subunit, configured to compress the height to a first preset size if the height of the second original picture is greater than the first preset size, and compress the width of the second original picture in equal proportion to obtain a second target picture;
and/or if the height and the width of the second original picture are both larger than the first preset size, compressing the height to the first preset size and compressing the width in equal proportion to obtain a third target picture if the height is larger than the width; if the width is larger than the height, compressing the width to a first preset size, and compressing the height in equal proportion to obtain a fourth target picture;
And forming a target picture set by at least one of the first target picture, the second target picture, the third target picture and the fourth target picture and a third original picture, wherein the third original picture is an uncompressed original picture in the original picture set.
Based on the above technical solutions, optionally, the scene building apparatus may specifically further include a target picture set determining module, where the module may specifically include:
the second compression unit is used for carrying out compression processing on the original picture set based on a preset compression rule before mapping the original picture set corresponding to each scene rendering assembly onto the target picture set, so as to obtain a compressed picture corresponding to each original picture;
a first compressed picture set determining unit, configured to determine a first compressed picture set forming each target picture, where the sizes corresponding to the width and the height of the target picture are both second preset sizes;
the target picture set determining unit is used for splicing the first compressed pictures in each first compressed picture set into target pictures by utilizing an image splicing algorithm to obtain target picture sets.
On the basis of the above technical solutions, optionally, the scene construction device may specifically further include a compressed picture integrity checking module, configured to splice each compressed picture in the compressed picture set into a target picture by using an image splicing algorithm, and determine whether all the compressed pictures are included in the target picture set after the target picture set is obtained;
If not, determining a second compressed picture which is not contained in the target picture set;
a first set of target pictures is generated based on the second compressed picture and the first set of target pictures is added to the set of target pictures.
On the basis of the above technical solutions, optionally, the scene construction device may specifically further include a compressed picture repetition checking module, configured to splice each compressed picture in the compressed picture set into a target picture by using an image splicing algorithm, and determine whether the target picture set includes a repeated third compressed picture after the target picture set is obtained;
and if so, deleting the repeated third compressed picture in the corresponding target picture.
Based on the above technical solutions, optionally, the scene building apparatus may specifically further include a configuration file determining module, configured to splice each compressed picture in the compressed picture set into a target picture by using an image stitching algorithm, and determine a configuration file of the target picture set after the target picture set is obtained, where the configuration file includes a compression mode of the target picture set, and the compression mode corresponds to an application platform of the target picture set.
The scene construction device provided by the embodiment of the invention can execute the scene construction method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention. Fig. 4 illustrates a block diagram of an exemplary computer device 412 suitable for use in implementing embodiments of the invention. The computer device 412 shown in fig. 4 is only an example and should not be construed as limiting the functionality and scope of use of embodiments of the invention.
As shown in FIG. 4, computer device 412 is in the form of a general purpose computing device. Components of computer device 412 may include, but are not limited to: one or more processors 416, a memory 428, a bus 418 that connects the various system components (including the memory 428 and the processor 416).
Bus 418 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 412 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer device 412 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 428 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 430 and/or cache memory 432. The computer device 412 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage 434 may be used to read from or write to non-removable, non-volatile magnetic media (not shown in FIG. 4, commonly referred to as a "hard disk drive"). Although not shown in fig. 4, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 418 via one or more data medium interfaces. Memory 428 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the invention.
A program/utility 440 having a set (at least one) of program modules 442 may be stored in, for example, memory 428, such program modules 442 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 442 generally perform the functions and/or methodologies in the described embodiments of the invention.
The computer device 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing device, display 424, etc., wherein the display 424 may be configured as desired), with one or more devices that enable a user to interact with the computer device 412, and/or with any device (e.g., network card, modem, etc.) that enables the computer device 412 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 422. Moreover, computer device 412 may also communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through network adapter 420. As shown, network adapter 420 communicates with other modules of computer device 412 over bus 418. It should be appreciated that although not shown in fig. 4, other hardware and/or software modules may be used in connection with computer device 412, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage, and the like.
The processor 416 executes various functional applications and data processing by running programs stored in the memory 428, for example, to implement the scene building method provided by the embodiments of the present invention.
Example five
A fifth embodiment of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a scene construction method as provided by the embodiments of the present invention, including:
mapping an original picture set corresponding to each scene rendering component onto a target picture set, wherein the original picture set is a picture set for constructing an original scene, and the target picture set is a picture set obtained by scaling the original picture set;
based on the original picture set and the target picture set, adjusting the original scaling of the corresponding scene rendering assembly to obtain the target scaling of each scene rendering assembly;
the original scene is constructed based on the target scale and the target picture set.
Of course, the computer-readable storage medium provided by the embodiments of the present invention, on which the computer program is stored, is not limited to performing the method operations described above, but may also perform related operations in the computer-device-based scene building method provided by any embodiment of the present invention.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
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.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (10)

1. A scene construction method, comprising:
mapping an original picture set corresponding to each scene rendering component onto a target picture set, wherein the original picture set is a picture set for constructing an original scene, and the target picture set is a picture set obtained by scaling the original picture set;
based on the original picture set and the target picture set, adjusting the original scaling of the corresponding scene rendering assembly to obtain the target scaling of each scene rendering assembly;
Constructing the original scene based on the target scaling and the target picture set;
wherein each picture in the original set of pictures corresponds to a scene rendering component.
2. The method of claim 1, wherein scaling the original set of pictures comprises:
and compressing the original picture set based on a preset compression rule to obtain a target picture set.
3. The method of claim 2, wherein compressing the original picture set based on a preset compression rule to obtain the target picture set comprises:
determining the size of each original picture in the original picture set;
if the width of the first original picture is larger than a first preset size, compressing the width to the first preset size, and carrying out equal-proportion compression on the height of the first original picture to obtain a first target picture;
and/or if the height of the second original picture is larger than the first preset size, compressing the height to the first preset size, and compressing the width of the second original picture in equal proportion to obtain a second target picture;
And/or if the height and the width of the second original picture are both larger than the first preset size, compressing the height to the first preset size and compressing the width in equal proportion to obtain a third target picture if the height is larger than the width; if the width is larger than the height, compressing the width to a first preset size, and compressing the height in equal proportion to obtain a fourth target picture;
and forming a target picture set by at least one of the first target picture, the second target picture, the third target picture and the fourth target picture and a third original picture, wherein the third original picture is an uncompressed original picture in the original picture set.
4. The method of claim 2, further comprising, prior to mapping the original set of pictures corresponding to each scene rendering component onto the target set of pictures:
based on the preset compression rule, compressing the original picture set to obtain compressed pictures corresponding to each original picture;
determining a first compressed picture set forming each target picture, wherein the corresponding sizes of the width and the height of the target pictures are second preset sizes;
And splicing the first compressed pictures in each first compressed picture set into a target picture by using an image splicing algorithm to obtain the target picture set.
5. The method of claim 4, wherein, after stitching each compressed picture in the set of compressed pictures into a target picture using an image stitching algorithm, the target picture set is obtained, further comprising:
determining whether the target picture set contains all compressed pictures;
if not, determining a second compressed picture which is not contained in the target picture set;
generating a first target picture set based on the second compressed picture, and adding the first target picture set to the target picture set.
6. The method of claim 4, wherein, after stitching each compressed picture in the set of compressed pictures into a target picture using an image stitching algorithm, the target picture set is obtained, further comprising:
determining whether the target picture set contains repeated third compressed pictures;
and if so, deleting the repeated third compressed picture in the corresponding target picture.
7. The method of claim 4, wherein, after stitching each compressed picture in the set of compressed pictures into a target picture using an image stitching algorithm, the target picture set is obtained, further comprising:
And determining a configuration file of the target picture set, wherein the configuration file comprises a compression mode of the target picture set, and the compression mode corresponds to an application platform of the target picture set.
8. A scene building apparatus, comprising:
the mapping module is used for mapping an original picture set corresponding to each scene rendering component onto a target picture set, wherein the original picture set is a picture set for constructing an original scene, and the target picture set is a picture set obtained by scaling the original picture set;
the scaling adjustment module is used for adjusting the original scaling of the corresponding scene rendering assembly based on the original picture set and the target picture set to obtain the target scaling of each scene rendering assembly;
an original scene construction module, configured to construct the original scene based on the target scaling and the target picture set;
wherein each picture in the original set of pictures corresponds to a scene rendering component.
9. A computer device, comprising:
one or more processing devices;
a memory for storing one or more programs;
When the one or more programs are executed by the one or more processing devices, the one or more processing devices are caused to implement the scene construction method of any of claims 1-7.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the scene construction method according to any of claims 1-7.
CN201911356104.5A 2019-12-25 2019-12-25 Scene construction method, device, equipment and storage medium Active CN111008934B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911356104.5A CN111008934B (en) 2019-12-25 2019-12-25 Scene construction method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911356104.5A CN111008934B (en) 2019-12-25 2019-12-25 Scene construction method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111008934A CN111008934A (en) 2020-04-14
CN111008934B true CN111008934B (en) 2023-08-29

Family

ID=70118323

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911356104.5A Active CN111008934B (en) 2019-12-25 2019-12-25 Scene construction method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111008934B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590220A (en) * 2021-08-02 2021-11-02 上海米哈游璃月科技有限公司 Method and device for detecting action resource configuration information, electronic equipment and medium
CN117274505B (en) * 2023-11-20 2024-03-05 广州中鸣数码科技有限公司 Display method and device for mapping image to building map

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107103638A (en) * 2017-05-27 2017-08-29 杭州万维镜像科技有限公司 A kind of Fast rendering method of virtual scene and model
CN109377542A (en) * 2018-09-28 2019-02-22 国网辽宁省电力有限公司锦州供电公司 Threedimensional model rendering method, device and electronic equipment
CN109640090A (en) * 2018-12-18 2019-04-16 深圳市丰巢科技有限公司 Picture compression method and device, equipment and storage medium
CN109712224A (en) * 2018-12-29 2019-05-03 青岛海信电器股份有限公司 Rendering method, device and the smart machine of virtual scene
CN109903366A (en) * 2019-03-13 2019-06-18 网易(杭州)网络有限公司 The rendering method and device of dummy model, storage medium and electronic equipment
CN110211195A (en) * 2019-05-22 2019-09-06 北京字节跳动网络技术有限公司 Generate method, apparatus, electronic equipment and the computer readable storage medium of image collection

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107103638A (en) * 2017-05-27 2017-08-29 杭州万维镜像科技有限公司 A kind of Fast rendering method of virtual scene and model
CN109377542A (en) * 2018-09-28 2019-02-22 国网辽宁省电力有限公司锦州供电公司 Threedimensional model rendering method, device and electronic equipment
CN109640090A (en) * 2018-12-18 2019-04-16 深圳市丰巢科技有限公司 Picture compression method and device, equipment and storage medium
CN109712224A (en) * 2018-12-29 2019-05-03 青岛海信电器股份有限公司 Rendering method, device and the smart machine of virtual scene
CN109903366A (en) * 2019-03-13 2019-06-18 网易(杭州)网络有限公司 The rendering method and device of dummy model, storage medium and electronic equipment
CN110211195A (en) * 2019-05-22 2019-09-06 北京字节跳动网络技术有限公司 Generate method, apparatus, electronic equipment and the computer readable storage medium of image collection

Also Published As

Publication number Publication date
CN111008934A (en) 2020-04-14

Similar Documents

Publication Publication Date Title
US8675000B2 (en) Command buffers for web-based graphics rendering
CN107204023B (en) Method and apparatus for avoiding distortion of graphics drawn in canvas
CN111882634B (en) Image rendering method, device, equipment and storage medium
CN111382123B (en) File storage method, device, equipment and storage medium
CN110912870B (en) Method, device, medium and electronic equipment for synchronizing data of electronic whiteboard
CN111008934B (en) Scene construction method, device, equipment and storage medium
CN110532497B (en) Method for generating panorama, method for generating three-dimensional page and computing device
CN110555900B (en) Rendering instruction processing method and device, storage medium and electronic equipment
CN110874172B (en) Method, device, medium and electronic equipment for amplifying APP interface
CN112416303B (en) Software development kit hot repair method and device and electronic equipment
CN111325668B (en) Training method and device for image processing deep learning model and electronic equipment
CN109408191A (en) Method for updating pages, device, equipment and storage medium
CN110069195B (en) Image dragging deformation method and device
CN111199569A (en) Data processing method and device, electronic equipment and computer readable medium
CN110889880A (en) Map processing method, device, equipment and storage medium
CN114866801B (en) Video data processing method, device, equipment and computer readable storage medium
CN113797554B (en) Game engine resource processing method and device, storage medium and electronic equipment
CN112367295B (en) Plug-in display method and device, storage medium and electronic equipment
CN113377376A (en) Data packet generation method, data packet generation device, electronic device, and storage medium
CN113626120A (en) Method and device for determining display page, electronic equipment and storage medium
CN111862342A (en) Texture processing method and device for augmented reality, electronic equipment and storage medium
CN112367399A (en) Filter effect generation method and device, electronic device and storage medium
CN112988276B (en) Resource package generation method and device, electronic equipment and storage medium
CN111080728A (en) Map processing method, device, equipment and storage medium
CN111639055B (en) Differential packet calculation method, differential packet calculation device, differential packet calculation equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant