src/shady

Source   Edit  

Shader macro, converts Nim code into GLSLDefault constructor for different GLSL types.List of function that GLSL provides, don't include their Nim src.Simply SKIP these functions.GLSL helper functions

Types

Attribute[T] = T
Source   Edit  
ImageBuffer = object
  image*: Image
Source   Edit  
Sampler2d = object
  image*: Image
Source   Edit  
SamplerBuffer = object
  data*: seq[float32]
Source   Edit  
UImageBuffer = object
  image*: Image
Source   Edit  
Uniform[T] = T
Source   Edit  
UniformWriteOnly[T] = T
Source   Edit  

Procs

proc imageLoad(buffer: var UniformWriteOnly[UImageBuffer]; index: int32): UVec4 {.
    ...raises: [], tags: [], forbids: [].}
Source   Edit  
proc imageStore(buffer: var Uniform[Sampler2d]; pos: IVec2; color: Vec4) {.
    ...raises: [], tags: [], forbids: [].}
Source   Edit  
proc imageStore(buffer: var UniformWriteOnly[ImageBuffer]; index: int32;
                color: Vec4) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc imageStore(buffer: var UniformWriteOnly[UImageBuffer]; index: int32;
                color: UVec4) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc texelFetch(buffer: Uniform[Sampler2d]; pos: IVec2; level: int): Vec4 {.
    ...raises: [], tags: [], forbids: [].}
Source   Edit  
proc texelFetch(buffer: Uniform[SamplerBuffer]; index: SomeInteger): Vec4
Source   Edit  
proc texture(buffer: Uniform[Sampler2d]; pos: Vec2): Vec4 {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc toGLSLInner(s: NimNode; version, extra: string): string {.
    ...raises: [Exception], tags: [RootEffect], forbids: [].}
Source   Edit  
proc vec4(c: ColorRGBX): Vec4 {....raises: [], tags: [], forbids: [].}
Source   Edit  

Macros

macro toGLSL(s: typed; version = "410"; extra = "precision highp float;\n"): string
Converts proc to a glsl string. Source   Edit