Hi all,
prior to the recent light source changes (was that in 2.0.15?) I had some shaders that I got off the AppGameKit forums that worked (some of the more recent ones still do work), however I cannot get this one to work any more.
If I do not assign the shader to the object the object shows the texture correctly (but no bumpmap)
If I assign the/enable the shader on the object, the object appears black
//Newly invalid lightsources declared in Main.agc
//CreateLightDirectional(1,sunx#,20.0,180,150,150,150)
//CreateLightPoint( 1, 50, 5, 50, 2500, 255, 255, 255)
//
//What I think are the equivalent lightsources now
SetSunActive(1)
SetSunDirection(0.0,100.0,0.0) //same as the old CreateLightDirectional?
CreatePointLight( 1, 0, 200, 0, 2500, 255, 255, 255 ) //same as the old CreateLightPoint?
function placeObjects()
Shader1=LoadShader("bumpmap-tiling-vertex.vs","bumpmap-pixel.ps")
SetShaderConstantByName( Shader1, "ambientPower",260.0 ,0,0, 0 )
SetShaderConstantByName( Shader1, "ambientMin",0.01 ,0,0, 0 )
SetShaderConstantByName( Shader1, "ambientMax",0.01 ,0,0, 0 )
SetShaderConstantByName( Shader1, "agk_PLightPos2",180.0 ,20.0,180, 80 )
SetShaderConstantByName( Shader1, "agk_PLightColor2",255.0 ,255.0,255.0, 0 )
SetShaderConstantByName( Shader1, "tiling",1.0,1.0,0, 0 )
mdlbuildtxt=loadimage("orange.png") //flat plain orange image
setimageminfilter(mdlbuildtxt,0)
setimagemagfilter(mdlbuildtxt,0)
setimagewrapu(mdlbuildtxt,1)
setimagewrapv(mdlbuildtxt,1)
bumpmap2=loadimage("orangepeel.jpg") //Bumpmap to give orange peel like look
setimagewrapu(bumpmap2,1) //1= repeat, 0= clamp
setimagewrapv(bumpmap2,1)
for n=1 to buildcount
building[n]=createobjectsphere(15,20,15)
setobjectimage(building[n],mdlbuildtxt,0)
SetObjectImage(building[n],bumpmap2,1)
SetObjectShader(building[n], Shader1)
ObjectSizeScaler# = Random(10,100)*0.01
SetObjectScale(building[n],ObjectSizeScaler#,ObjectSizeScaler#,ObjectSizeScaler#)
setobjectposition(building[n],randomsign(random(0,groundsize/2)),3,randomsign(random(0,groundsize/2))) //set to -1 so everything marries to ground
setobjectlightmode(building[n],1)
next n
endfunction
I know very little of shaders, but I am convinced this is a lighting issue, so can somebody either point me in the right direction on how to fix them, or update the attached shader?
I have tried several other older shaders (from the last 6-12 months) and most have this issue (show black) on both Windows and Linux.
Thanks
It\'s late, I\'m tired, out of coffee and now I\'m wet.