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  
Sampler2dArray = object
  images*: seq[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  
USampler2d = object
  image*: Image
Source   Edit  

Vars

gl_Position: Vec4
Source   Edit  
gl_VertexID: uint32
Source   Edit  

Procs

proc dFdx(a: Vec2): Vec2 {....raises: [Exception], tags: [], forbids: [].}
Source   Edit  
proc dFdy(a: Vec2): Vec2 {....raises: [Exception], tags: [], forbids: [].}
Source   Edit  
proc fwidth(a: Vec2): Vec2 {....raises: [Exception], tags: [], forbids: [].}
Source   Edit  
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 texelFetch(buffer: Uniform[USampler2d]; pos: IVec2; level: int): UVec4 {.
    ...raises: [], tags: [], forbids: [].}
CPU stub for usampler2D; not used at runtime. Returns zeros. Source   Edit  
proc texture(buffer: Uniform[Sampler2d]; pos: Vec2): Vec4 {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc textureGrad(s: Uniform[Sampler2d]; uv: Vec3; dUVdx: Vec2; dUVdy: Vec2): Vec4 {.
    ...raises: [], tags: [], forbids: [].}
Source   Edit  
proc textureGrad(s: Uniform[Sampler2dArray]; uvw: Vec3; dUVdx: Vec2; dUVdy: Vec2): Vec4 {.
    ...raises: [], tags: [], forbids: [].}
Source   Edit  
proc textureSize(buffer: Uniform[Sampler2d]; level: int): Vec2 {....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