Shader code multiplexing method and terminal
A code reuse and shader technology, which is applied in the shader code reuse method and the terminal field, can solve the problems of increasing system overhead, reducing shader execution efficiency, and failing to achieve rendering effects, etc., to achieve the effect of increasing consumption
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0071] Please refer to figure 1 , Embodiment 1 of the present invention is:
[0072] A shader code reuse method, specifically comprising:
[0073] S1. Obtain a shader macro in the shader source code;
[0074] S2. Classify the shader macros according to their functions, and generate a shader macro combination;
[0075] Please refer to Figure 5 , classifying the shader macros into global macros, local macros, light macros and real-time macros;
[0076] Global macros: apply to all shaders, control the basic rendering framework logic of shaders, such as lighting model-related calculation processes, shadow calculation processes, fog calculation processes, platform-related calculation processes, rendering quality, etc.;
[0077] Local macros: act on a single shader to control the calculation logic of shader special effects, such as vertex animation special effects, ripple special effects, dissolution special effects, etc.;
[0078] Lighting macro: applies to all shaders, contr...
Embodiment 2
[0102] A shader code reuse method, which differs from Embodiment 1 in that:
[0103] In S3, according to the actual rendering task, the corresponding shader macro combination is selected, and the shader macro combination set is generated specifically as follows:
[0104] According to the actual rendering task, select a shader macro combination in each shader macro category;
[0105] generating a shader macro combination set according to a shader combination selected in each shader macro category;
[0106] According to the actual rendering task, select the corresponding shader macro combination, and generate the shader macro combination set including:
[0107] Analyzing the completed rendering task, selecting a corresponding shader macro combination according to the analysis result of the completed rendering task, and generating a preconfigured shader macro combination set according to the selected shader macro combination;
[0108] According to the actual rendering task, sel...
Embodiment 3
[0115] Apply the above shader code reuse method to the actual scene:
[0116] Need to render a scene with configurable quality level, obtain the shader macro in the shader source code, such as: PBR lighting model calculation macro, Phong lighting model calculation macro, fog calculation macro, quality level macro, skin calculation Macros, Outer Glow Mapping Macros, Lighting Calculation Macros, Point Light Number Macros, and Bloom Macros;
[0117] Classify the above shader macros
[0118] Global macro: PBR lighting model calculation macro, Phong lighting model calculation macro, fog calculation macro, image quality level macro;
[0119] Local macros: skinning calculation macros, outer light texture macros, lighting calculation macros;
[0120] Light macro: point light source number macro;
[0121] Live macro: flood macro;
[0122] Generate shader macro combinations:
[0123] Global macro combination 1: PBR lighting model calculation macro, Phong lighting model calculation ...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com