I want to learn HLSL, so I've been looking at some tutorials on shaders online. I was trying this tutorial:
http://www.neatware.com/lbstudio/web/hlsl.html
but I couldn't seem to get it working - the object would just act as if hidden when I applied the shader.
Then, I took a look at some of the shaders in the free shader pack (in particular, I looked at one of Evolved's shaders) and it seemed like the structure of the .fx is nothing like what is described here. So, are there different forms of HLSL? And, what's the difference? Also, does DBPro suppport all of them?
And, while I'm at it, I would like to ask all of the people here who can write shaders how they learned - can you suggest a book or web page?
UPDATE:
I just tried this:
http://www.cfxweb.net/modules.php?name=News&file=article&sid=1305
tutorial, and again, it just hid my object. I've got an nvidia geforce 5200, brand new, so I don't think it's my hardware... also, all of the examples from the free shader pack work for me, so shouldn't these work too?
EDIT:
Oh, yea, here's the code I'm using (press space to apply test.fx):
global shader$="test.fx"
global tex_in_shader=1
set window on
set window size 800,600
sync on
sync rate 60
autocam off
make object cube 1,10
make object plain 2,50,50
xrotate object 2,90
position object 2,0,-15,0
fix object pivot 2
zrotate object 1,45
position object 1,0,0,0
fix object pivot 1
position camera 0,10,30
point camera 0,-5,0
set camera range .1,300
color_image(1,255,0,0)
texture object 1,1
color_image(2,0,255,0)
texture object 2,2
hide light 0
make light 1
set directional light 1,-1.0,-1.0,-1.0
`set effect on 1,shader$,tex_in_shader
d=0
repeat
if spacekey() then set effect on 1,shader$,tex_in_shader
d=wrapvalue(d+1)
yrotate object 1,d
sync
until escapekey()
end
function color_image(n,r,g,b)
create bitmap 1,1,1
dot 0,0,rgb(r,g,b)
get image n,0,0,1,1
set current bitmap 0
delete bitmap 1
endfunction
Harvard's Law, as Applied to Computers:
Under the most rigorously controlled conditions of pressure, temperature, volume, humidity and other variables, the computer will do as it d*mn well pleases.