Semantics, e.g. the " : Diffuse"-thingie, why?

I never really understand what this “: Diffuse”-thingie is all about? Because as far as I’ve experienced it it works pretty well without it, when I’ve written some simple test shaders.

I also found that when scripting in the Unity game engine you use the same kind of thing for variables, like this:

var newGameObject : GameObject

This tells Unity that you can drag-n-drop an Game Object in the Unity Editor to be assigned to be used by that script. So is this kind of thing like telling the computer what kind of variable this is? In C++ you have to tell what kind of variable it is, like this:

int myInt = 2;
string myString = "This is a string";

Or what is the deal with this:

something-something [B]: SOMETHING[/B]

What is it called, you know in techiqual/programming terms? And what is it? Please explain for a noob :):

In HLSL, the thingie you’re referring to is called a semantic. When using them in conjunction with items in the header of the shader, they’re usually optional - but it really depends on whether or not the specific application that parses the shader is designed to use them or not.

The application can use the semantic to connect something in a different part of the program to that part of the shader. For example, in 3ds Max, the texture that you use the : Diffuse annotation with will be the texture that is displayed on the render ball in the material editor.

In general, it’s a method for attaching one thing to another thing.

Thanks Ben :slight_smile: That cleared it out a lot better for me.

Honestly tho’, when you are performing on a haphazard BG and not wow gold regularise in the top 20 on the TR, what do you look to complete? I am pretty sure tonights Ming blog instrument continue to anally defeat Complexness, so I module yield the intermission to him virtually buy wow gold .After watching SK EU vs SK USA and then watching SK USA v Complexity, it was pretty sad how much worsened complexness was at running PMR.