Cross-platform shader language configuration method

A configuration method and shader technology, applied in the computer field, can solve problems such as inconsistent rendering effects, and achieve the effect of reducing performance consumption, ensuring consistency, and ensuring rendering effects.

CN112612459APending Publication Date: 2021-04-06广州引力波信息科技有限公司
0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Publication Date
2021-04-06
Patent Text Reader

Abstract

The invention discloses a cross-platform shader language configuration method, and relates to the technical field of computers. The method comprises the steps of converting a rendering algorithm of a Unity engine from a GLSL language to an HLSL language according to the rendering algorithm of a Realibox engine at a Unity engine end; adding a pre-compiling head in the Unity engine according to a macro branch for controlling a shader language in the Realibox engine; and at the Unity engine end, improving the illumination model of the Realibox engine according to the GPU architectures of different platforms, so that the illumination model of the Realibox engine is matched with the illumination model of the Unity engine. According to the method, the problem of inconsistent rendering effects between the Unity engine and the Realibox engine is solved, and the consistency of the rendering effects under GPU architectures of different platforms can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention relates to the technical field of computers, in particular to a cross-platform shader language configuration method. Background technique

[0002] The different architectures between different engines lead to each engine having its own set of shader compilation systems. Among them, the Realibox engine uses macros to dynamically generate and compile shader languages, and the Unity engine uses the entire shader code for compilation, resulting in There is a problem of inconsistent rendering effects between the Unity engine and the Realibox engine, and the problem of inconsistent rendering effects under the GPU architecture of different platforms. Contents of the invention

[0003] In order to solve the deficiencies of the prior art, the embodiment of the present invention provides a cross-platform shader language configuration method, the method includes the following steps:

[0004] On the Unity engine side, convert the rendering algorit...

Examples

Embodiment Construction

[0028] The present invention will be specifically introduced below in conjunction with specific embodiments.

[0029] The cross-platform shader language configuration method provided by the embodiment of the present invention includes the following steps:

[0030] S101, on the Unity engine side, convert the rendering algorithm of the Unity engine from GLSL language to HLSL language according to the rendering algorithm of Realibox engine;

[0031] S102, adding a precompiled header in the Unity engine according to the macro branch controlling the shader language in the Realibox engine;

[0032] S103, on the Unity engine side, improve the lighting model of the Realibox engine according to the GPU architecture of different platforms, so that the lighting model of the Realibox engine matches the lighting model of the Unity engine.

[0033] Among them, different platforms include PC terminal and mobile terminal.

[0034] Optionally, converting the rendering algorithm of the Unity ...