something to show, something to ask

Posted By: ello

something to show, something to ask - 09/27/03 22:02

i put my hands onto the assembler language(the brute force way of coding):

the files - i'd like to know if this works on other computers, too.

now the questions:
in the beta text there are some descriptions for
v0[3] - position
v3[3] - normal
v7[2] - tex coord1
v8[2] - tex coord2

but in a description i found thy are somehow different and described as read only,so why do they vary:
v0[3] - position x,y,z,w
v1[3] - vertex weight w,0,0,1
v2[3] - normal x,y,z,1
v3[3] - primary color r,g,b,a
v4[3] - secondary color r,g,b,a
v5[3] - fog coefficient fc,0,0,1
v6[3] - tex coord1 s,t,r,q
v7[3] - tex coord2 s,t,r,q

however there is no description of the symbols like s,t,q,r - what do they stand for
and why are there 4 values for the texture coordinates instead of 2 like in beta text

and by the way, can anyone show me how to code a counter, or tell me how to use add and mul for example. i always get errors when i pu my hands on them.
Posted By: seb_dup1

Re: something to show, something to ask - 09/27/03 23:12

It work fine with me.
Strange the description you found ; with the multiple Microsoft's exercises , i always the same déclaration :

VertexShader =
decl
{
stream 0;
float v0[3]; // Position
float v3[3]; // Normal
float v7[3]; // Texture coord1
float v8[3]; // Texture coord2
}
or

VertexShader =
decl
{
stream 0;
float v0[3]; // Position
float v3[3]; // Normal
float v7[3]; // Texture Coord1
float v8[3]; // Tangent
}

Posted By: ventilator

Re: something to show, something to ask - 09/28/03 02:29

v0[3] - position
v3[3] - normal
v7[2] - tex coord1
v8[2] - tex coord2

the vertex data gets provided by the engine. you can't use anything different!

s,t,r,q are four dimensional texture coordinates. with a6 you just can use u,v which is the same as s,t i guess?

you can't do loops in vertex shader version 1.1! ...for what purpose would you like to have a counter?

add and mul works like that:
Code:

add r0,r1,r2 does r0.x=r1.x+r2.x, r0.y=r1.y+r2.y, r0.z=r1.z+r2.z, r0.w=r1.w+r2.w
mul r0,r1,r2 does r0.x=r1.x*r2.x, r0.y=r1.y*r2.y, r0.z=r1.z*r2.z, r0.w=r1.w*r2.w


Posted By: ello

Re: something to show, something to ask - 09/28/03 18:02

so, if they are provided by the engine, i could need a complete overview which are available, cause the general informations on vertex and pixel shader assembler available on the net are different to the ones which come with the engine. so i cannot use them and i dont know which ones i can use. i also like to see an example on how to implement a pixel shader , in betatext there is only vertex shader. i have some examples for pixel shader assembler, but i dont know how to implement them into a6.

so registers get cleared before the next run of the asm-script? then actually i dont need a counter.
Posted By: ventilator

Re: something to show, something to ask - 09/28/03 21:01

Quote:

so registers get cleared before the next run of the asm-script?



yes, registers don't keep their contents when the vertexshader ends. the shader gets executed for each vertex individually and only information about the current vertex is known.

Quote:

i also like to see an example on how to implement a pixel shader, in betatext there is only vertex shader.



have a look at my terrain multitexturing shader! it's a very simple vertex/pixelshader example.

Quote:

so, if they are provided by the engine, i could need a complete overview which are available, cause the general informations on vertex and pixel shader assembler available on the net are different to the ones which come with the engine.



it's always

v0[3] - position
v3[3] - normal
v7[2] - tex coord1
v8[2] - tex coord2

with a6! nothing else is available.

v8 is a second texture coordinate set which is used for the shadowmaps on levelgeometry i guess. so you won't need this for models, terrains or sprites.
Posted By: ello

Re: something to show, something to ask - 09/29/03 02:33

thanks for clearing me up.
i saw your script just after i posted this questions, i did some tweaking here and there , get many many errors, because of the usage of the registers i think.
somehow i get strange results. i got a nice texture movement(it went into the direction of a refraction-like style), but only if the entity moves/rotates..

how are you going on this. i always get a large amount of errors, befor i see anything.

I saw many VertexShaderConstant[x] definitions. is that the cx register used in the shader itself?

© 2024 lite-C Forums