Image rendering method for structure, fluid dynamics and thermal simulation scene
By using the puzzle algorithm to splice multiple pictures into large images in structure, fluid dynamics and thermal simulation scenarios, and updating the texture coordinate data, the problem that texture pictures of objects of different material cannot be merged into one batch is solved, and efficient image rendering is achieved and performance is improved.
Patent Information
- Application Number
- CN202411313680.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-03-28
AI Technical Summary
In structural, fluid dynamics and thermal simulation scenarios, due to the large amount of calculation, the pictures cannot be batched, which affects performance, and the texture pictures of objects of different materials cannot be merged into one batch, resulting in frequent data submission from CPU to GPU and limited performance.
By obtaining multiple pictures in the structure, fluid dynamics and thermal simulation scene, using the puzzle algorithm to splice them into large images, record the texture coordinates of each picture corresponding to the entire large image, update the vertex coordinates and texture coordinate data to the data corresponding to the entire large image, and upload them to the GPU at one time by the CPU, perform Draw Call once, and complete the drawing and rendering of all pits.
By assembling the texture pictures of objects of different materials into a large texture picture, each pit is drawn using a sub-area of the large texture picture, which meets the requirement that it can be merged into a batch, reduces the frequency of data submission from CPU to GPU, and improves rendering performance.
Smart Images

Figure CN119722887A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an image rendering method for structural, fluid dynamics and thermal simulation scenes. Background Art
[0002] Structural, fluid dynamics and thermal simulation scenes are usually drawn using GPUs, which ensures drawing performance and clarity. The software interface of the GPU is generally implemented using the general cross-platform interface of OpenGL. The drawing process of OpenGL generally specifies fixed-point data, texture coordinate data, texture data, lighting, and some scene matrix data as input. Then the GPU generates the image to be displayed according to the OpenGL pipeline after obtaining this data. These data are created in the CPU, so the CPU needs to transfer these data to the GPU. Each drawing requires such a transmission, which is very time-consuming. NVIDIA once proposed at GDC that 25K batches / sec will consume a full 1GHz CPU with a 100% utilization rate. The performance of the GPU cannot be brought into play and is limited by the CPU bandwidth. In response to this bottleneck, OpenGL proposed the concept of batch processing, that is, when there are drawings with the same data (except vertex data and texture coordinate data), they can be merged into one drawing (draw call), thus avoiding the above-mentioned problems. However, the batch needs to meet certain conditions, that is, as mentioned just now, other data except vertex data and texture coordinate data must be the same before merging. This requires that the drawn objects, except for their positions, must have the same texture data and scene matrix data, otherwise they cannot be merged. That is, the above-mentioned problems will still exist. The other properties of the model texture of the simulation scene are the same, but the displayed model, that is, the texture data in OpenGL, are different, so they cannot be merged into one draw call or one batch for processing. In other words, the drawing of each pit position requires a data submission from the CPU to the GPU. Each pit position needs to make a draw call in each frame, which means a data submission from the CPU to the GPU, which has a great impact on performance.
[0003] The existing solution generally recommends using the same material for drawn objects, that is, using the same texture and the same image as much as possible. This is reflected in various game engines, but this method is not suitable for rendering simulation scenes, because the model texture images displayed in the simulation scene are definitely not the same.
[0004] Based on this, the present invention proposes an image rendering method for structural, fluid dynamics and thermal simulation scenes, so that texture images of objects of different materials can meet the requirement of being merged into one batch. Summary of the invention
[0005] The present invention provides an image rendering method for structural, fluid dynamics and thermal simulation scenes, so that texture images of objects of different materials can meet the requirement of being merged into one batch.
[0006] According to one aspect of the present invention, there is provided an image rendering method for structural, fluid dynamics and thermal simulation scenes, the method comprising:
[0007] Get multiple pictures in the structural, fluid dynamics and thermal simulation scenes, stitch them into a large picture through the jigsaw algorithm, and record the texture coordinates of each picture corresponding to the entire large picture;
[0008] Update the original vertex coordinates and texture coordinates of each pit position to the vertex coordinates and texture coordinates corresponding to the entire large image, and store them in the CPU memory;
[0009] Merge all the pit data, and then the CPU uploads the coordinate data of all the pit vertices and textures that have been stored to the GPU at one time, executes a Draw Call, and completes the drawing and rendering of all the pits.
[0010] Optionally, the images are stitched together into a larger image using a jigsaw algorithm, including:
[0011] The images are classified according to their sizes, and the images of the same size are joined into a large image through a jigsaw algorithm.
[0012] Optionally, the images are stitched together into a larger image using a jigsaw algorithm, including:
[0013] When stitching pictures together, a gap of 1 to 2 pixels needs to be maintained between the pictures.
[0014] Optionally, record the texture coordinates of each image corresponding to the entire large image, including:
[0015] The texture width and height coordinates of the entire large image after splicing are set to 0-1.
[0016] Optionally, the method further includes:
[0017] When updating the data of the corresponding target image in the structure, fluid dynamics or thermal simulation scene in the entire large image, only the image data of the area corresponding to the target image in the entire large image is updated.
[0018] Optionally, when updating the data of the target image corresponding to the structure, fluid dynamics or thermal simulation scene in the entire large image, only the image data of the area corresponding to the target image in the entire large image is updated, including:
[0019] When updating the data of the corresponding target image in the structure, fluid dynamics or thermal simulation scene in the entire large image, the OpenGL interface: glTexSubImage2D(GLenum target, GLint level, GLintxoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenumtype, constvoid*pixels) is used to update the image data of the area corresponding to the target image in the entire large image;
[0020] Among them, xoffset in the OpenGL interface glTexSubImage2D represents the offset value in the x direction, yoffset represents the offset value in the y direction, width represents the width of the image to be updated, and height represents the height of the image to be updated.
[0021] Optionally, after all the pit positions are rendered, the following steps are also included:
[0022] When displaying images in structural, fluid dynamics, and thermal simulation scenes, the original texture coordinates are modified to relative texture coordinates corresponding to the corresponding area in the entire large image to specify the location of the actual drawn image in the entire large image.
[0023] According to another aspect of the present invention, there is provided an image rendering device for structural, fluid dynamics and thermal simulation scenes, the device comprising:
[0024] Image stitching module, used to obtain multiple images in the structural, fluid dynamics and thermal simulation scenes, stitch them into a large image through a jigsaw algorithm, and record the texture coordinates of each image corresponding to the entire large image;
[0025] The image data storage module is used to update the vertex coordinates and texture coordinates of each original pit position to the vertex coordinates and texture coordinates corresponding to the entire large image, and store them in the CPU memory;
[0026] The image drawing and rendering module is used to merge all the pit data, and then the CPU uploads the coordinate data of all the pit vertices and textures that have been stored to the GPU at one time, executes a Draw Call, and completes the drawing and rendering of all the pits.
[0027] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0028] at least one processor; and
[0029] a memory communicatively connected to the at least one processor; wherein,
[0030] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the image rendering method for structural, fluid dynamics and thermal simulation scenes described in any embodiment of the present invention.
[0031] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the image rendering method for structural, fluid dynamics and thermal simulation scenes described in any embodiment of the present invention when executed.
[0032] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the image rendering method for structural, fluid dynamics and thermal simulation scenes described in any embodiment of the present invention.
[0033] The technical solution of the embodiment of the present invention obtains multiple pictures in the structure, fluid dynamics and thermal simulation scenes, splices them into a large picture through a jigsaw algorithm, and records the texture coordinates of each picture corresponding to the entire large picture; updates the original vertex coordinates and texture coordinate data of each pit position to the vertex coordinates and texture coordinates corresponding to the entire large picture, and stores them in the CPU memory; merges all the pit position data, and then the CPU uploads the stored coordinate data of all the pit position vertices and textures to the GPU at one time, executes a DrawCall, and completes the drawing and rendering of all the pit positions, which solves the problem that pictures cannot be batch processed due to the amount of calculation in the structure, fluid dynamics and thermal simulation scenes, affecting performance. Texture pictures of objects of different materials can be assembled into a large texture picture, and each pit position uses a sub-area of the large texture picture for drawing, so that each pit position has the same texture data, which meets the requirement of being merged into a batch.
[0034] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0036] Figure 1is a flow chart of an image rendering method for structural, fluid dynamics and thermal simulation scenes provided according to an embodiment of the present invention;
[0037] Figure 2 is a flow chart of an image rendering method for structural, fluid dynamics and thermal simulation scenes provided according to an embodiment of the present invention;
[0038] Figure 3 is a schematic structural diagram of an image rendering device for structural, fluid dynamics and thermal simulation scenes provided according to an embodiment of the present invention;
[0039] Figure 4 It is a schematic diagram of the structure of an electronic device for implementing the image rendering method for structure, fluid dynamics and thermal simulation scenes according to an embodiment of the present invention. DETAILED DESCRIPTION
[0040] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0041] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, 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 that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0042] Figure 1 This is a flowchart of an image rendering method for structure, fluid dynamics and thermal simulation scenes provided according to an embodiment of the present invention. This embodiment is applicable to batch rendering of images in structure, fluid dynamics and thermal simulation scenes. The method can be executed by an image rendering device for structure, fluid dynamics and thermal simulation scenes. The image rendering device for structure, fluid dynamics and thermal simulation scenes can be implemented in the form of hardware and / or software. The image rendering device for structure, fluid dynamics and thermal simulation scenes can be configured in an electronic device such as a computer. Figure 1 As shown, the method includes:
[0043] Step 110: obtain multiple pictures in the structure, fluid dynamics and thermal simulation scenes, stitch them into a large picture through a jigsaw algorithm, and record the texture coordinates of each picture corresponding to the entire large picture.
[0044] Step 120: Update the original vertex coordinates and texture coordinate data of each pit position to the vertex coordinates and texture coordinates corresponding to the entire large image, and store them in the CPU memory.
[0045] Step 130: merge all the pit data, and then the CPU uploads the coordinate data of all the pit vertices and textures that have been stored to the GPU at one time, executes a Draw Call, and completes the drawing and rendering of all the pits.
[0046] Optionally, the images are stitched together into a large image using a jigsaw algorithm, including: classifying the images according to their size, and stitching the images of the same size into a large image using a jigsaw algorithm. Classifying the images by size can save memory. Stitching images of similar size together and ensuring that the stitching is as neat as possible can avoid small areas that waste space.
[0047] Optionally, the images are stitched together into a large image using a jigsaw algorithm, including: when stitching images, a gap of 1 to 2 pixels needs to be maintained between the images, so as to avoid intercepting the sub-area of the large image corresponding to the image when displaying the image, which may cause the image boundary to be easily intercepted out of bounds.
[0048] Optionally, record the texture coordinates of each image corresponding to the entire large image, including: the texture width and height coordinates of the entire large image after splicing are set to 0-1.
[0049] Optionally, the method further includes: when updating data of a corresponding target image in a structure, fluid dynamics or thermal simulation scene in the entire large image, only updating image data of an area in the entire large image that corresponds to the target image.
[0050] Optionally, when data of the target image corresponding to the structure, fluid dynamics or thermal simulation scene in the entire large image is updated, only the image data of the area corresponding to the target image in the entire large image is updated, including: when data of the target image corresponding to the structure, fluid dynamics or thermal simulation scene in the entire large image is updated, the OpenGL interface: glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenumtype, constvoid*pixels) is used to update the image data of the area corresponding to the target image in the entire large image; wherein, the xoffset in the OpenGL interface glTexSubImage2D represents the offset value in the x direction, yoffset represents the offset value in the y direction, width represents the width of the image to be updated, and height represents the height of the image to be updated.
[0051] Optionally, after completing the drawing and rendering of all pit positions, it also includes: when displaying pictures in structure, fluid dynamics and thermal simulation scenes, modifying the original texture coordinates to relative texture coordinates corresponding to the corresponding area in the entire large picture, so as to specify the position of the actual drawn picture in the entire large picture.
[0052] By obtaining multiple pictures in the structural, fluid dynamics and thermal simulation scenes, splicing them into a large picture through the jigsaw algorithm, recording the texture coordinates of each picture corresponding to the entire large picture; updating the original vertex coordinates and texture coordinate data of each pit position to the vertex coordinates and texture coordinates corresponding to the entire large picture, and storing them in the CPU memory; merging all the pit position data, and then the CPU uploads the coordinate data of all the pit position vertices and textures that have been stored to the GPU at one time, executes a DrawCall, and completes the rendering of all pit positions, solving the problem that pictures cannot be batch processed due to the amount of calculation in the structural, fluid dynamics and thermal simulation scenes, affecting performance. Specifically, all the texture pictures to be displayed by the simulation model are assembled into a large texture picture, and each simulation model uses a sub-area of this large texture picture, so that each simulation model is guaranteed to have the same texture data, which also meets the requirement of being merged into a batch, thereby solving the above-mentioned problems. In this way, the drawing efficiency of structural, fluid dynamics and thermal simulation and rendering is improved, and the effect of real-time efficient display and interaction is achieved.
[0053] Figure 2 FIG. 1 is a flowchart of an image rendering method for a structure, fluid dynamics, and thermal simulation scene provided according to an embodiment of the present invention. Figure 2As shown in the figure, a specific application process of this method is: load pictures in the structure, fluid dynamics and thermal simulation scenes. If there are multiple pictures, they are stitched into a large picture through a jigsaw algorithm, and the texture coordinates of each picture corresponding to the entire large picture are recorded. After that, the original vertex coordinates and texture coordinate data of each pit are updated to the vertex coordinates and texture coordinates corresponding to the entire large picture, and stored in the CPU memory; merge all the pit data, and then the CPU uploads all the stored pit vertex and texture coordinate data to the GPU at one time, executes a Draw Call, and completes the drawing and rendering of all pits; draws to the buffer; and displays the rendering results on the screen.
[0054] If the image is a single one, skip the image stitching, and directly upload the coordinate data of all the stored pit vertices and textures to the GPU at one time by the CPU, execute a Draw Call, complete the drawing and rendering of all pits; draw to the buffer; and display the rendering results on the screen.
[0055] Figure 3 1 is a schematic diagram of a structure of an image rendering device for structural, fluid dynamics and thermal simulation scenes provided according to an embodiment of the present invention. Figure 3 As shown, the device includes: a picture splicing module 310, a picture data storage module 320, and a picture drawing and rendering module 330. Among them:
[0056] The image stitching module 310 is used to obtain multiple images in the structure, fluid dynamics and thermal simulation scenes, stitch them into a large image through a jigsaw algorithm, and record the texture coordinates of each image corresponding to the entire large image;
[0057] The image data storage module 320 is used to update the vertex coordinates and texture coordinates of each original pit position to the vertex coordinates and texture coordinates corresponding to the entire large image, and store them in the CPU memory;
[0058] The picture drawing and rendering module 330 is used to merge all the pit data, and then the CPU uploads the coordinate data of all the pit vertices and textures that have been stored to the GPU at one time, executes a Draw Call, and completes the drawing and rendering of all the pits.
[0059] Optionally, the picture stitching module 310 includes:
[0060] The image classification unit is used to classify images according to their sizes and to combine images of the same size into a large image through a jigsaw algorithm.
[0061] Optionally, the picture stitching module 310 includes:
[0062] The stitching unit is used to maintain a gap of 1 to 2 pixels between pictures when stitching pictures.
[0063] Optionally, the picture stitching module 310 includes:
[0064] The texture coordinate determination unit is used to set the texture width and height coordinates of the entire stitched large image to 0-1.
[0065] Optionally, the device further includes:
[0066] The local image update module is used to update only the image data of the area corresponding to the target image in the entire large image when updating the data of the corresponding target image in the structure, fluid dynamics or thermal simulation scene in the entire large image.
[0067] Optional, partial image update module, including:
[0068] The local image update unit is used to update the image data of the area corresponding to the target image in the structure, fluid dynamics or thermal simulation scene in the entire large image using the OpenGL interface: glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenumformat, GLenumtype, constvoid*pixels);
[0069] Among them, xoffset in the OpenGL interface glTexSubImage2D represents the offset value in the x direction, yoffset represents the offset value in the y direction, width represents the width of the image to be updated, and height represents the height of the image to be updated.
[0070] Optionally, the device further includes:
[0071] The display module is used to modify the original texture coordinates to the relative texture coordinates corresponding to the corresponding area in the entire large image when displaying the images in the structure, fluid dynamics and thermal simulation scenes after completing the drawing and rendering of all pit positions, so as to specify the position of the actual drawn image in the entire large image.
[0072] The image rendering device for structure, fluid dynamics and thermal simulation scenes provided by the embodiment of the present invention can execute the image rendering method for structure, fluid dynamics and thermal simulation scenes provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0073] Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0074] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0075] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0076] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as image rendering methods for structural, fluid dynamics, and thermal simulation scenes.
[0077] In some embodiments, the image rendering method for structural, fluid dynamics and thermal simulation scenes can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the image rendering method for structural, fluid dynamics and thermal simulation scenes described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the image rendering method for structural, fluid dynamics and thermal simulation scenes in any other appropriate manner (for example, by means of firmware).
[0078] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0079] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0080] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 of the foregoing.
[0081] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0082] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0083] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0084] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0085] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An image rendering method for structural, fluid dynamics and thermal simulation scenes, characterized in that: include: Get multiple pictures in the structural, fluid dynamics and thermal simulation scenes, stitch them into a large picture through the jigsaw algorithm, and record the texture coordinates of each picture corresponding to the entire large picture; Update the original vertex coordinates and texture coordinates of each pit position to the vertex coordinates and texture coordinates corresponding to the entire large image, and store them in the CPU memory; Merge all the pit data, and then the CPU uploads the coordinate data of all the pit vertices and textures that have been stored to the GPU at one time, executes a Draw Call, and completes the drawing and rendering of all the pits.
2. The method according to claim 1, characterized in that The jigsaw puzzle algorithm is used to stitch the large image together, including: The images are classified according to their sizes, and the images of the same size are joined into a large image through a jigsaw algorithm.
3. The method according to claim 1, characterized in that The jigsaw puzzle algorithm is used to stitch the large image together, including: When stitching pictures together, a gap of 1 to 2 pixels needs to be maintained between the pictures.
4. The method according to claim 1, characterized in that Record the texture coordinates of each image corresponding to the entire large image, including: The texture width and height coordinates of the entire large image after splicing are set to 0-1.
5. The method according to claim 2, characterized in that: Also includes: When updating the data of the corresponding target image in the structure, fluid dynamics or thermal simulation scene in the entire large image, only the image data of the area corresponding to the target image in the entire large image is updated.
6. The method according to claim 5, characterized in that When updating the data of the corresponding target image in the structure, fluid dynamics or thermal simulation scene in the entire large image, only the image data of the area corresponding to the target image in the entire large image is updated, including: When updating the data of the corresponding target image in the structure, fluid dynamics or thermal simulation scene in the entire large image, the OpenGL interface: glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenumtype, constvoid*pixels) is used to update the image data of the area corresponding to the target image in the entire large image; Among them, xoffset in the OpenGL interface glTexSubImage2D represents the offset value in the x direction, yoffset represents the offset value in the y direction, width represents the width of the image to be updated, and height represents the height of the image to be updated.
7. The method according to claim 1, characterized in that After completing the rendering of all the pits, it also includes: When displaying images in structural, fluid dynamics, and thermal simulation scenes, the original texture coordinates are modified to relative texture coordinates corresponding to the corresponding area in the entire large image to specify the location of the actual drawn image in the entire large image.
8. An image rendering device for structural, fluid dynamics and thermal simulation scenes, characterized in that: include: Image stitching module, used to obtain multiple images in the structural, fluid dynamics and thermal simulation scenes, stitch them into a large image through a jigsaw algorithm, and record the texture coordinates of each image corresponding to the entire large image; The image data storage module is used to update the vertex coordinates and texture coordinates of each original pit position to the vertex coordinates and texture coordinates corresponding to the entire large image, and store them in the CPU memory; The image drawing and rendering module is used to merge all the pit data, and then the CPU uploads the coordinate data of all the pit vertices and textures that have been stored to the GPU at one time, executes a Draw Call, and completes the drawing and rendering of all the pits.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the image rendering method for structural, fluid dynamics and thermal simulation scenes described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the image rendering method for structure, fluid dynamics and thermal simulation scenes according to any one of claims 1 to 7 when executed.