Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

HLSL varying variable alternative

Name: bawls 2011-11-12 11:02

How would I go about passing values calculated in the vertex shader to the pixel shader?
Whats HLSL's alternative to GLSL's varying variable?

Name: Anonymous 2011-11-12 11:08

as a texcoord

Name: bawls 2011-11-12 11:59

*cough*
Could someone give me a simple example of, let's say passing a single float value from the VS to the PS.

Name: Anonymous 2011-11-12 13:13

*vomit over face*

Name: Anonymous 2011-11-12 16:24

Maybe you could just, you know, not use a proprietary language and use GLSL instead.

Name: bawls 2011-11-12 17:11

My circumstances require I use HLSL.

Anyway I got that passing a variable thing down, though I've come across a new problem.
I'm calculating the dot product for the normal vector and light direction, however the result is always zero (or something, idk).

...
void main (in float3 norm : NORMAL0,...) {
...
float3 light = {1,1,1};
float x = dot(light,norm);
...
}

^ Is that technically correct?

Name: Anonymous 2011-11-12 17:21

may I suggest you a lesser forum for this task? /prog/ is only for discussing better languages like LISP and brainfuck.
try gamedev

Don't change these.
Name: Email:
Entire Thread Thread List