This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资源工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
创建内容
内容优化
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Noise Functions

This documentation article contains information functions of the UUSL. This information can be used as the reference document for writing shaders.

To start using common UUSL functionality, include the core/materials/shaders/api/noise.h file.

UUSL
#include <core/materials/shaders/api/noise.h>

Noise Functions#

float4 blueNoise ( uint2 coord ) #

Returns blue noise based on the source coordinates using a 16x16 constant blue noise array.

Arguments

  • uint2 coord - Unnormalized coordinates.

Return value

Blue noise.

float4 blueNoise ( float2 coord ) #

Returns blue noise based on the source coordinates using a 16x16 constant blue noise array.

Arguments

  • float2 coord - Unnormalized coordinates.

Return value

Blue noise.

float4 blueNoiseTemporal ( uint2 coord, uint num_frame ) #

Returns blue noise based on source coordinates using a 16x16 constant blue noise array. You can specify the number of frames for the noise to change. It is a constant blue noise array with a frame-to-frame offset calculated using Golden Ratio.

Arguments

  • uint2 coord - Unnormalized coordinates.
  • uint num_frame - Number of frames for the noise to change.

Return value

Blue noise.

float4 blueNoiseTAA ( uint2 coord, uint num_frame ) #

Returns blue noise based on source coordinates using a 16x16 constant blue noise array. You can specify the number of frames for the noise to change. It is a constant blue noise array with a frame-to-frame offset calculated using Golden Ratio.

The TAA postfix means that noise pattern changes from frame to frame when TAA is enabled, and remains constant when TAA is disabled.

Arguments

  • uint2 coord - Unnormalized coordinates.
  • uint num_frame - Number of frames for the noise to change.

Return value

Blue noise.

float4 blueNoiseTAA ( float2 coord, uint num_frame ) #

Returns blue noise based on source coordinates using a 16x16 constant blue noise array. You can specify the number of frames for the noise to change. It is a constant blue noise array with a frame-to-frame offset calculated using Golden Ratio.

The TAA postfix means that noise pattern changes from frame to frame when TAA is enabled, and remains constant when TAA is disabled.

Arguments

  • float2 coord - Unnormalized coordinates.
  • uint num_frame - Number of frames for the noise to change.

Return value

Blue noise.

float4 blueNoiseTemporal ( float2 coord, uint num_frame ) #

Returns blue noise based on source coordinates using a 16x16 constant blue noise array. You can specify the number of frames for the noise to change. It is a constant blue noise array with a frame-to-frame offset calculated using Golden Ratio.

Arguments

  • float2 coord - Unnormalized coordinates.
  • uint num_frame - Number of frames for the noise to change.

Return value

Blue noise.

float bayerNoise ( uint2 coord ) #

Returns Bayer noise generated based on the source coordinates using a 4x4 constant Bayer pattern.

Arguments

  • uint2 coord - Unnormalized coordinates.

Return value

Bayer noise.

float bayerNoise ( float2 coord ) #

Returns Bayer noise generated based on the source coordinates using a 4x4 constant Bayer pattern.

Arguments

  • float2 coord - Unnormalized coordinates.

Return value

Bayer noise.

float2 vogelDisk ( uint i, uint count, float noise ) #

Returns a generated set of points with X and Y coordinates in the [-1; 1] range that describe a circle with uniform distribution of samples inside. This method is suitable for getting uniform distribution of coordinates for a circle. For example you can use it is a loop to generate UV coordinates offset for making the uniform circular blur effect. You can use the current loop iteration index as the i argument and the maximum number of iterations — as count.

Arguments

  • uint i - Index of the current point for the disk.
  • uint count - Number of points.
  • float noise - Normalized noise.

Return value

Set of points with X and Y coordinates in the [-1; 1] range that describe a circle with uniform distribution of samples inside.

float2 vogelDisk ( uint i, uint count ) #

Returns a generated set of points with X and Y coordinates in the [-1; 1] range that describe a circle with uniform distribution of samples inside. This method is suitable for getting uniform distribution of coordinates for a circle. For example you can use it is a loop to generate UV coordinates offset for making the uniform circular blur effect. You can use the current loop iteration index as the i argument and the maximum number of iterations — as count.

Arguments

  • uint i - Index of the current point for the disk.
  • uint count - Number of points.

Return value

Set of points with X and Y coordinates in the [-1; 1] range that describe a circle with uniform distribution of samples inside.

float2 hammersley ( uint i, uint N ) #

Returns a generated set of points with X and Y coordinates in the [0; 1] range that describe uniform distribution of samples inside a square (Hammersley Point Set).

Arguments

  • uint i - index of the current point.
  • uint N - Number of points.

Return value

Set of points with X and Y coordinates in the [-1; 1] range that describe uniform distribution of samples inside a square.
Last update: 2022-12-14
Build: ()