SparkSL
SparkSL API
Textures

Textures

 * Automatically imported - explicit import not required *


Declarations

 // Structs
 struct Texture2d{
 function<vec4(vec2)> sample;
 vec2 size;
 function<vec4(vec2,float)> sampleLod;
 };
    


Data Structures - Texture2d

Struct describing a 2D texture.

Declarations

 struct Texture2d{
     function<vec4(vec2)> sample;
     vec2 size;
     function<vec4(vec2,float)> sampleLod;
 };
    


Members

  • sample: Function that samples the texture at the specified coordinates in normalized texture space.
  • size: Size of the texture in pixels.
  • sampleLod: Function that samples the texture at the specified coordinates in normalized texture space and explicit level-of-detail.

    If both the arguments are computed in the vertex stage, the sampling will also be performed in the vertex stage. Similarly, if any of the arguments are computed in the fragment stage, the sampling will also be performed in the fragment stage.

    The Vertex Texture Fetch capability is required for sampleLod to work in the vertex stage.




Was this article helpful?