Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Constants in Vertex Shader Data Type

Author
Message
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 1st May 2003 11:18
Hi, does anyone know what are the constant values for the vertex shader data type used in the SET VERTEX SHADER STREAM command.

The help text contains the constants value for the Vertex Shader Data. But it doesn't mention anything about the Vertex Shader Data Type constatns, i.e. the value for VSDT_FLOAT2, VSDT_FLOAT3, etc.

Thanks!
Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 1st May 2003 11:48
Vertex Stream if the FVF you're feeding it the data types you put in are the FVF header bits in the order in which they're used in the model

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 1st May 2003 16:41
Hehehe.... I am a slow learner. Can you provide me a short example?
Thanks a bunch!

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 1st May 2003 16:54
For example, in the Basic3D examples of DBpro,

set vertex shader stream VsNumber, 1, VSDE_POSITION, VSDT_FLOAT3
set vertex shader stream VsNumber, 2, VSDE_NORMAL, VSDT_FLOAT3
set vertex shader stream VsNumber, 3, VSDE_DIFFUSE, VSDT_D3DCOLOR
set vertex shader stream VsNumber, 4, VSDE_TEXCOORD0, VSDT_FLOAT2

it defines the constant at the begining of the program as below,
VSDT_FLOAT2=0x01 : VSDT_FLOAT3=0x02 : VSDT_D3DCOLOR=0x04

Where can I get the information about the value for the rest of the data type. As far as I know, as stated in the Direct3D Vertex Shader documentation, there are 6 data types: VSDT_D3DCOLOR, VSDT_FLOAT1, VSDT_FLOAT2, VSDT_FLOAT3, VSDT_FLOAT4 and VSDT_UBYTE4.


How do I know the value for each of these constants?
Thanks!

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st May 2003 21:32
The paper manual lists them, but nowhere else seems to.

VSDT_FLOAT1=0x00
VSDT_FLOAT2=0x01
VSDT_FLOAT3=0x02
VSDT_FLOAT4=0x03
VSDT_D3DCOLOR=0x04
VSDT_UBYTE4=0x05
VSDT_SHORT2=0x06
VSDT_SHORT4=0x07

... whatever they mean!
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 1st May 2003 23:31
from what i've noticed you don't really need the values unless you're working in formats that the stream won't recognise.

for example if you do
set vertex shader stream VsNumber, 0, VSDE_POSITION, NULL
you don't need the type because DirectX should already know that it needs a Vector3 (Float 3) type... but if you're using a LAST_BETA position then you have to declare this like this

set vertex shader stream VsNumber, 0, VSDE_POSITION, VSDT_FLOAT3+VSDT_FLOAT1
which would be for XYZW

problem is i can't seem to figure out what the LAST_BETA flag actually is... i mean i think its 0x001, but then again i kinda get the feeling its not anymore.

also remember the declaration value you're setting has to match with what you've put in the shader itself...
position v0-v2 then you declare as 0
normal v3-5 then you declare it as 3
you have to remember to leave the number of data positions your declare between them - else you get messed up data, that goes fot the constants as well.

as for the values... they're quite simple to figure out
all they are, are binary flags for a UINT system

VSDT_FLOAT1=0x00 (%000) 1 Float - X
VSDT_FLOAT2=0x01 (%001) 2 Float - X,Y
VSDT_FLOAT3=0x02 (%010) 3 Float - X,Y,Z
VSDT_FLOAT4=0x03 (%011) 4 Float - X,Y,Z,W
VSDT_D3DCOLOR=0x04 (%100) 1 Dword - RGB Value
VSDT_UBYTE4=0x05 (%101) 1 Dword - 4x 1byte integers (in bitshift)
VSDT_SHORT2=0x06 (%110) 1 Word - 2 byte integer
VSDT_SHORT4=0x07 (%111) 1 Dword - 4 byte integer

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?

Login to post a reply

Server time is: 2026-07-11 12:01:15
Your offset time is: 2026-07-11 12:01:15