OK, so this is the first time in my life I have used a shader. With that said, here is my problem:
First of all, I was not able to get my textures working with the shader in the example files from evolved. All I did is replace one of the texture files with my texture files, but it didn't achieve the effect I wanted. Here are the two texture files I used:
One is the usual texture, and the other is a normal map texture created with gimp.
The example from evolved is attached to this post. I added those two textures above into the example, but it's not doing what I want. Any suggestions?
Then comes the problem with integrating it into my game... This is pretty much the way I load the level. I tried adding it in already, but it doesn't do anything either... Any help greatly appreciated ^^
rem light arrays
t=10
dim lx#(t) as float
dim ly#(t) as float
dim lz#(t) as float
dim lax#(t) as float
dim lay#(t) as float
dim lrange#(t) as float
dim lin#(t) as float
dim lout#(t) as float
dim ltype(t) as byte
dim lr(t) as byte
dim lg(t) as byte
dim lb(t) as byte
rem setup vectors
vec=make vector4(1)
rem load effects
load effect "FX\ReliefMapping.fx",1,0
rem load scene object
load object "Models\"+stagepath$+"\"+stagename$+".x",11
set object light 11,1
set object transparency 11,4
rem read in texture file and texture scene
open to read 1,"Models\"+stagepath$+"\texture.txt"
repeat
rem read string
read string 1,string$
rem ignore
if left$(string$,2)="//" or string$="END" then goto texture_ignore
rem load all textures
if left$(string$,8)="textures"
magnify=val(right$(string$,4))
for t=1 to magnify
read string 1,string$
load image "Models\"+stagepath$+"\"+right$(string$,len(string$)-4),t+10000
load image "Models\"+stagepath$+"\"+left$(right$(string$,len(string$)-4),len(right$(string$,len(string$)-4))-4)+"_n"+right$(string$,4),t+20000
next t
endif
rem apply textures to limbs
if left$(string$,5)="limbs"
magnify=val(right$(string$,4))
for t=1 to magnify
read string 1,string$
if val(right$(string$,4))>0
texture limb 11,t,0,10000+val(right$(string$,4))
texture limb 11,t,1,20000+val(right$(string$,4))
endif
next t
endif
texture_ignore:
until string$="END"
close file 1
rem add relief mapping shader
set object effect 11,1
rem load lights
open to read 1,"Models\"+stagepath$+"\"+stagename$+".lm"
read string 1,cc$
read word 1,lights
rem load and apply lights to scene
for t=0 to lights
rem read info
read float 1,f#:lx#(t)=f#
read float 1,f#:ly#(t)=f#
read float 1,f#:lz#(t)=f#
read float 1,f#:lax#(t)=f#
read float 1,f#:lay#(t)=f#
read float 1,f#:lrange#(t)=f#
read float 1,f#:lin#(t)=f#
read float 1,f#:lout#(t)=f#
read byte 1,success:ltype(t)=success
read byte 1,success:lr(t)=success
read byte 1,success:lg(t)=success
read byte 1,success:lb(t)=success
read byte 1,success
rem make lights
if t>0 then make light t
if ltype(t)=1 then set spot light t,lin#(t),lout#(t)
position light t,lx#(t),ly#(t),lz#(t)
rotate light t,lax#(t),lay#(t),0
set light range t,lrange#(t)
color light t,rgb(lr(t),lg(t),lb(t))
rem set shader lights
set vector4 1,lx#(t),ly#(t),lz#(t),0
set effect constant vector 1,"LightPosition_"+str$(t+1),1
set vector4 1,lr(t),lg(t),lb(t),0
set effect constant vector 1,"LightColor_"+str$(t+1),1
set effect constant float 1,"LightRange_"+str$(t+1),lrange#(t)
if t=0 then set effect technique 1,"Ambient"
if t>0 then set effect technique 1,"Light"+str$(t)
next t
close file 1
TheComet