Package com.codename1.gpu.shader


package com.codename1.gpu.shader

Portable custom shading for com.codename1.gpu.

A ShaderNode is one value of a shader -- a constant, an input such as the world position or the time, a texture sample, or math on other nodes. A ShaderMaterial attaches graphs of them to hooks of the engine's own shader (VERTEX_OFFSET, BASE_COLOR, NORMAL, METALLIC, ROUGHNESS, EMISSIVE, DISCARD), so custom surfaces are still lit, shadowed and fogged. Every backend prints the same graph in its own language through ShaderEmitter: GLSL on Android, the browser, the simulator and Linux, Metal on Apple platforms and HLSL on Windows.

  • Class
    Description
    Prints ShaderNode graphs as statements of one shading language.
    The shading languages a graph prints as.
    Supplies the backend's spelling of the inputs a graph reads.
    Evaluates ShaderNode graphs on the CPU, with the same results the GPU computes from the same graph.
    Reads a material texture for the evaluator.
    Custom shading for a com.codename1.gpu.Material: a set of ShaderNode graphs, each replacing one input of the engine's own shader.
    An input of the engine's shader that a graph can replace.
    One value in a portable shader: a constant, a uniform, a built-in input such as the world position, a texture sample, or an operation on other nodes.
    The value type of a ShaderNode.