Skip to main content
gamedev.net
🔒 Locked

GLSL - struct definition

Started by mirkar 3 replies 1.3k views
Original Post
mirkar
mirkar
Hi All,

struct below is taken from a vertex shader example. I´m just wandering that what does the colon mean (what functionality it has)?

struct OUTPUT {
vector pos : POSITION;
float2 uv : TEXCOORD0;
float z : TEXCOORD1;
float alpha : TEXCOORD2;
};

thnks. in advance
karwosts
karwosts
That's not GLSL, looks like HLSL or CG, not sure.
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game
Pooya65
Pooya65
Quote:
That's not GLSL, looks like HLSL or CG, not sure.

yes

that is like CG or HLSL defination, but may be works on some nvidia graphic cards. you can combine CG and GLSL on some nv graphics cards and use them together but that isn't safe.
Hodgman
Hodgman
As above, that's HLSL/CG code (same thing), not GLSL.

Anyway, the colon, and the word after it is a semantic. It specifies which "slot" each one of those variables will be placed in.
mirkar
mirkar
thanks - everybody!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.