- Substance 3D home
- Home
- Getting Started
- Getting Started overview
- Activation and licenses
- System requirements
- Project creation
- Export
- Export overview
- Export window
- Export presets
- Export overview
- Glossary
- Performance
- Getting Started overview
- Interface
- Assets
- Substance 3D Assets
- Color picker
- Display settings
- History
- Layer stack
- Main menu
- Project configuration
- Properties
- Settings
- Shader settings
- Texture Set
- Toolbars
- Viewport
- Miscellaneous
- Assets
- Painting
- Painting overview
- Tool list
- Straight line
- Lazy mouse
- Symmetry
- Fill projections
- Presets
- Presets overview
- Creating and saving presets
- Creating particles presets
- Photoshop brush presets (ABR)
- Dynamic strokes
- Advanced channel painting
- Vector graphic (.svg & .ai)
- Text resource
- Effects
- Baking
- Content
- Creating custom effects
- Importing assets
- Creating custom effects
- Features
- Automatic UV Unwrapping
- Physical size
- Smart Materials and Masks
- Subsurface Scattering
- Dynamic Material Layering
- UV Reprojection
- UV Tiles
- Color Management
- Post Processing
- Iray Renderer
- Plugins
- Sparse Virtual Textures
- Custom Shaders
- SpaceMouse® by 3Dconnexion
- Universal Scene Description (USD)
- Send to
- Technical Support
- Performance Guidelines
- Configuring Pens and Tablets
- Exporting the log file
- Exporting a DXDiag
- Technical issues
- GPU Issues
- Crash when working with overclocked GPU
- Forcing the external GPU on Mac OS
- GPU drivers compatibility
- GPU drivers crash with long computations (TDR crash)
- GPU has outdated drivers
- GPU is not recognized
- GPU is not recognized and is mentionned as GDI Generic
- Issues with Nvidia GPUs on recent Mac OS versions
- Multi/Bi-GPU
- Running on integrated GPU
- Painter doesn't start on the right GPU
- Startup Issues
- Rendering Issues
- Stability Issues
- Miscellaneous Issues
- GPU Issues
- Workflow Issues
- Export Issues
- Tools Issues
- Project Issues
- Library Issues
- Viewport Issues
- Plugins Issues
- License Issues
- Pipeline and integration
- Installation and preferences
- Configuration
- Resource management
- Scripting and development
- Scripts and plugins
- Shader API Reference
- Shader API overview
- Changelog - Shader API
- Libraries - Shader API
- Lib Alpha - Shader API
- Lib Bayer - Shader API
- Lib Defines - Shader API
- Lib Emissive - Shader API
- Lib Env - Shader API
- Lib Normal - Shader API
- Lib PBR - Shader API
- Lib PBR Aniso - Shader API
- Lib Pom - Shader API
- Lib Random - Shader API
- Lib Sampler - Shader API
- Lib Sparse - Shader API
- Lib SSS - Shader API
- Lib Utils - Shader API
- Lib Vectors - Shader API
- Parameters - Shader API
- Shaders - Shader API
- Release notes
- Release notes overview
- All Changes
- Version 10.1
- Version 10.0
- Version 9.1
- Old versions
- Version 9.0
- Version 8.3
- Version 8.2
- Version 8.1
- Version 7.4
- Version 7.3
- Version 7.2
- Version 2021.1 (7.1.0)
- Version 2020.2 (6.2.0)
- Version 2020.1 (6.1.0)
- Version 2019.3
- Version 2019.2
- Version 2019.1
- Version 2018.3
- Version 2018.2
- Version 2018.1
- Version 2017.4
- Version 2017.3
- Version 2017.2
- Version 2017.1
- Version 2.6
- Version 2.5
- Version 2.4
- Version 2.3
- Version 2.2
All Engine Params - Shader API
Engine parameters examples
Texture parameters
Substance Painter uses a Sparse Virtual Texture (SVT) system to display textures in the viewport.
For more information about this system, go to the online documentation.
This system has repercussions on how to write shader code. We are providing helpers to simplify its use with the SamplerSparse structure and texture lookup functions (see lib-sparse.glsl).
Basic usage:
// Defines the SamplerSparse structure import lib-sparse.glsl //: param auto TEXTURE_TAG uniform SamplerSparse uniform_tex; // Texture sampler and its information
Texture parameters allow to use 'or' operator to define a fallback:
//: param auto TEXTURE_TAG_1 or TEXTURE_TAG_2 uniform SamplerSparse uniform_tex; // if TEXTURE_TAG_1 exists then TEXTURE_TAG_1 else TEXTURE_TAG_2
Where TEXTURE_TAG is one of the described tags below.
Document's channels tags
All these textures are premultiplied and dilated to avoid seams problems.
Texture set channels
channel_ambientocclusion channel_anisotropyangle channel_anisotropylevel channel_basecolor channel_blendingmask channel_diffuse channel_displacement channel_emissive channel_glossiness channel_height channel_ior channel_metallic channel_normal channel_opacity channel_reflection channel_roughness channel_scattering channel_specular channel_specularlevel channel_transmissive
User channels
channel_user0 channel_user1 channel_user2 channel_user3 channel_user4 channel_user5 channel_user6 channel_user7
Mesh maps
texture_ambientocclusion : Ambient Occlusion map
texture_curvature : Curvature map
texture_id : ID map
texture_normal : Tangent space normal map
texture_normal_ws : World space normal map
texture_position : World space position map
texture_thickness : Thickness map
Additional texture parameters
Basic usage:
//: param auto TEXTURE_TAG uniform sampler2D uniform_tex; // The texture itself //: param auto TEXTURE_TAG_size uniform vec4 uniform_tex_size; // The size of the texture (width, height, 1/width, 1/height)
Texture parameters allow to use 'or' operator to define a fallback:
//: param auto TEXTURE_TAG_1 or TEXTURE_TAG_2 uniform sampler2D uniform_tex; // if TEXTURE_TAG_1 exists then TEXTURE_TAG_1 else TEXTURE_TAG_2 //: param auto TEX_TAG_1_size or TEX_TAG_2_size uniform vec4 uniform_tex_size; // if TEX_TAG_1 exists then TEX_TAG_1_size else TEX_TAG_2_size
Where TEXTURE_TAG is one of the described tags below.
texture_blue_noise : A blue noise texture
texture_environment : Environment map, mip-mapped, use lib-env.glsl to use this one
Other parameters
aspect_ratio : a float containing the viewport width / height ratio
//: param auto aspect_ratio uniform float uniform_aspect_ratio;
camera_view_matrix : a mat4 representing the transformation from world space to camera space
//: param auto camera_view_matrix uniform mat4 uniform_camera_view_matrix;
camera_view_matrix_it : inverse transpose version of camera_view_matrix
//: param auto camera_view_matrix_it uniform mat4 uniform_camera_view_matrix_it;
camera_vp_matrix_inverse : inverse of projection * camera_view_matrix matrix
//: param auto camera_vp_matrix_inverse uniform mat4 uniform_camera_vp_matrix_inverse;
environment_exposure : a float representing the envmap's exposure
//: param auto environment_exposure uniform float uniform_environment_exposure;
environment_max_lod : a float representing the envmap's depth of mip-map pyramid
//: param auto environment_max_lod uniform float uniform_max_lod;
environment_rotation : a float representing the envmap's rotation around up axis
the value is in the range [0,1] and should be maped to the range [0, 2*pi]
//: param auto environment_rotation uniform float uniform_environment_rotation;
facing : an integer indicating rendered faces (-1: back faces, 0: undefined, 1: front faces)
value of 0 means you can safely rely on glsl built-in variable gl_FrontFacing
//: param auto facing uniform int uniform_facing;
fovy : a float representing the camera field of view along Y axis
//: param auto fovy uniform float uniform_fovy;
is_2d_view : a bool indicating whether the rendering is performed for 2D view or not
//: param auto is_2d_view uniform bool uniform_2d_view;
is_perspective_projection : a bool indicating whether the projection is perspective or orthographic
//: param auto is_perspective_projection uniform bool uniform_perspective_projection;
main_light : a vec4 indicating the position of the main light in the environment
//: param auto main_light uniform vec4 uniform_main_light;
mvp_matrix : a mat4 representing the model view projection matrix
//: param auto mvp_matrix uniform mat4 uniform_mvp_matrix;
scene_original_radius : a float representing the radius of the scene's bounding sphere before its normalization
//: param auto scene_original_radius uniform float uniform_scene_original_radius;
screen_size : a vec4 containing screen size data (width, height, 1/width, 1/height)
//: param auto screen_size uniform vec4 uniform_screen_size;
world_camera_direction : a vec3 representing the world camera orientation
//: param auto world_camera_direction uniform vec3 uniform_world_camera_direction;
world_eye_position : a vec3 representing the world eye position
//: param auto world_eye_position uniform vec3 uniform_world_eye_position;