Cross-platform modularized shader language general integration method

An integrated method and shader technology, applied in the field of image rendering, can solve the problems of time-consuming rendering process, difficult maintenance, unsupported shaders, etc., and achieve the effect of improving rendering performance, improving programming efficiency, and rendering program flexibility

Pending Publication Date: 2022-02-22
DALIAN NEUSOFT UNIV OF INFORMATION
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0008] The existing technology has the following defects: First, there are restrictions on the use of compiling GLSL into SPIR-V, that is, in the actual use process, the shader needs to set parameters according to the macro definition, so the shader program can only be defined according to the incoming macro definition Compile online to generate SPIR-V, and then decompile it into the Shader corresponding to each platform. This requires two steps of online compilation and decompilation, which makes the entire rendering process very time-consuming and often cannot be used directly in the rendering engine.
Second, shaders do not support the module import syntax of high-level languages ​​such as C / C++, which leads to the fact that when writing shaders, the underlying common code segments have to be distributed in each shader, which makes it difficult to maintain
Unable to achieve module versatility

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Cross-platform modularized shader language general integration method
  • Cross-platform modularized shader language general integration method
  • Cross-platform modularized shader language general integration method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0025] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions 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 It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

[0026] figure 1 It is a flow chart of the method of the present invention, as figure 1 As shown, the method of this embodiment may include:

[0027] A general integration method of cross-platform modular shader language, which realizes the general integration scheme of real-time cross-platform modular shader language, and combines the custom mod...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a cross-platform modularized shader language general integration method which comprises the following steps: defining the format and grammar of a macro definition analysis file, and creating the macro definition analysis file; creating a grammar parser Shader-X, and pre-compiling a shader file by using the Shader-X parser; analyzing the macro definition analysis file, generating a macro definition result set, and generating a macro definition result ordered list according to the macro definition result set; respectively calculating hash values of the ordered list of the macro definition results, generating shader files of the platforms corresponding to the macro definition results respectively according to the macro definition results, pre-compiling the shader files into binary files through a Shader-X analyzer, and marking the binary files through the Hash values of the macro definition results and the platforms; and locating and executing the binary file by the rendering program according to the hash value of the macro definition result ordered list and the platform. The same shader code can be used on different platforms, online compiling is not needed, a modular programming scheme is supported, and the shader programming efficiency is improved.

Description

technical field [0001] The invention relates to the technical field of image rendering, in particular to a cross-platform modular shader language general integration method. Background technique [0002] Image rendering is the process of converting a 3D radiosity process into a 2D image. Scenes and entities are expressed in three-dimensional form, which is closer to the real world and easy to manipulate and transform, while most of the graphics display devices are two-dimensional rasterized displays and dot-matrix printers. From the representation of the three-dimensional solid scene to the representation of N-dimensional raster and rasterization is image rendering—that is, rasterization. The raster display can be regarded as a pixel matrix, and any graphic displayed on the raster display is actually a collection of pixels with one or more colors and grayscales. [0003] The shader language Shader Language currently has three main languages: OpenGL Shading Language based o...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F8/41G06T15/00G06T15/50
CPCG06F8/427G06T15/005G06T15/50
Inventor 刘歆宁
Owner DALIAN NEUSOFT UNIV OF INFORMATION
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products