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.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Publication Date
- 2021-04-06
Abstract
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 ...