Home | Tutorials | Articles | Categories | Channel list | SDK | Exporting | F.A.Q.
Articles/Quest3D Semantics
From Quest3D
< Articles(Redirected from Quest3D Semantics)
Contents |
[edit]
Quest3D HLSL Semantics
[edit]
Semantics overview
The table below shows a list of non-standard semantics available in Quest3D.
| Name | Semantic | Description |
| float | CHANNELVALUE0 | A value linked to the HLSL channel. The number at the end is the index of the child. |
| float4 | CHANNELVECTOR0 | A vector linked to the HLSL channel. The number at the end is the index of the child. |
| Float4x4 | CHANNELMATRIX0 | A matrix linked to the HLSL channel. The number at the end is the index of the child. |
| texture | COLORMAP0 | A texture linked to the surface channel. The number at the end is the index of the child. |
| texture | ENVIRONMENTCUBE | The global cube map that was set using the command channel. |
| float | NLIGHTS | The number of active lights |
| float[8] | LIGHTPHI | Float array containing the inner angle of the spotlights falloff if the light is a spotlight. |
| float[8] | LIGHTTHETA | Float array containing the outer angle of the spotlights falloff if the light is a spotlight. |
| float[8] | LIGHTATT3 | Float array containing the 3rd falloff parameter of the lights(exponential falloff). |
| float[8] | LIGHTATT2 | Float array containing the 2nd falloff parameter of the lights(linear falloff). |
| float[8] | LIGHTATT1 | Float array containing the 1st falloff parameter of the lights(constant falloff). |
| float[8] | LIGHTTYPE | Float array containing the type of each light. |
| float4[8] | LIGHTPOS | Float array containing the position of each light. |
| float4[8] | LIGHTCOLOR | Float array containing the color of each light. |
| float4[8] | LIGHTDIR | Float array containing the direction of each light. |
| float | FOGFALLOFF1 | The fog falloff parameter1. |
| float | FOGFALLOFF2 | The fog falloff parameter2. |
| float | FOGTYPE | The fog falloff type. |
| float4 | FOGCOLOR | The color of the fog. |
| bool | ENABLEFOG | A boolean that is True if fog is enabled. |
| float4x3 | WORLDMATRIXARRAY | An array of matrices containing the matrix for each bone. |
| bool | UseSkinning | A boolean that is true if the object is skinned. |
| bool | UseTangent | Define this value somewhere if you want Quest3D to generate tangents for the model. |
| bool | UseBiNormal | Define this value somewhere if you want Quest3D to generate binormals for the model. |
| bool | DisableObjectClipping | Define this variable to disable frustrum clipping. You need to do this if your shader does not use a simple WorldViewProjection to calculate the final screen position. |
[edit]
Example
These are all types you get in your shader:
#define MAX_LIGHTCOUNT 8
#define LIGHT_TYPE_NONE 0
#define LIGHT_TYPE_POINT 1
#define LIGHT_TYPE_SPOT 2
#define LIGHT_TYPE_DIRECTIONAL 3
#define FOG_TYPE_LINEAR 0
#define FOG_TYPE_EXP 1
#define FOG_TYPE_EXP2 2
// when this is defined clipping is disabled
float dummy : DisableObjectClipping;
// Quest3D puts this value to true when the
// shader is used on a skinned mesh
bool useSkinning : UseSkinning;
// when this is defined Quest3D generates binormals for the mesh
float dummy2 : UseBiNormal;
// when this is defined Quest3D generates tangents for the mesh
float dummy3 : UseTangent;
// Light parameters
float lightPhi[MAX_LIGHTCOUNT] : LIGHTPHI;
float lightThetha[MAX_LIGHTCOUNT] : LIGHTTHETA;
float lightAtt3[MAX_LIGHTCOUNT] : LIGHTATT3;
float lightAtt2[MAX_LIGHTCOUNT] : LIGHTATT2;
float lightAtt1[MAX_LIGHTCOUNT] : LIGHTATT1;
float lightType[MAX_LIGHTCOUNT] : LIGHTTYPE;
float4 lightPos[MAX_LIGHTCOUNT] : LIGHTPOS;
float4 lightcolor[MAX_LIGHTCOUNT] : LIGHTCOLOR;
float4 lightDirection[MAX_LIGHTCOUNT] : LIGHTDIR;
float lightcount : NLIGHTS = 0;
// Fog parameters
float fogParam1 : FOGFALLOFF1;
float fogParam2 : FOGFALLOFF2;
float fogType : FOGTYPE;
float4 fogColor : FOGCOLOR;
bool bEnableFog : ENABLEFOG;
// local parameters
float fMaterialPower : CHANNELVALUE0<
string UIName = "Specular Power";
string UIWidget = "Slider";
float UIMin = 1;
float UIMax = 100;
> = 32.f;
float4 vMaterialColor : CHANNELVECTOR0<
string UIName = "Diffuse color";
string UIWidget = "Color";
> = float4 (192.f/255.f, 128.f/255.f, 96.f/255.f, 1.f);
texture cubeMap : ENVIRONMENTCUBE;
texture colorMap : COLORMAP0;
[edit]
See Also
| One Level Up - Channel List |
| Back to Main Index |
| To report documentation errors, contact info@quest3d.com |
Categories: Tutorials | HLSL | Shaders
