he everyone.
I would want to know if to someone of you it has problems to use the
bumpmapping and .fx shader with DarkGame SDK.
I have tried more times to compile examples converted from DarkBasic
Professional in Visual C++.net 2003 but I do not succeed to see nothing, also using the shaders I do not obtain no result.
Some examples I have taken them from the forum and you are converted, but nothing, while all it works well in DarkBasic Professional.
Someone could say me why?
Example from [DarkBASIC Professional DiscussionThe Ultimate Shader Thread 2.0]
DBPRO:
` =============================================
` == SHADER: Parallax and Normal Mapping ==
` =============================================
` Made for DBPro 5.2
`=== Set Resolution =======================================
if check display mode(1024,768,32)=1 THEN set display mode 1024,768,32
`=== Initialise System ====================================
autocam off
sync on : sync rate 60
hide mouse
set global collision off
backdrop on
color backdrop 0
randomize timer()
`=== Load a Model =========================================
load object "4Cube.x",1
`=== Load and Apply Parallax Shader =======================
load effect "Parallax20.fx",1,1
set object effect 1,1
temp=make vector4(1)
temp=make vector4(2)
temp=make vector4(3)
temp=make vector4(4)
set vector4 2,1.0,1.0,0.5,1.0 `Light Direction
set vector4 3,0.9,0.9,0.9,1.0 `Light Colour
set vector4 4,0.3,0.3,0.3,1.0 `Ambient Light
`=== Pre-set Values =======================================
zoom#=72.0
camera#=0.0
rotateX#=0.0
rotateY#=0.0
`=== LOOP BEGINS ====================================================
while escapekey()=0
`=== Display Instructions =================================
set cursor 0,0
print "Press ESCAPE to exit"
print ""
print "Use Cursor Keys to Zoom"
print "Use Mouse to Rotate Object"
`=== Position and Rotate Camera ===========================
if upkey()=1 THEN zoom#=zoom#-2.0
if downkey()=1 THEN zoom#=zoom#+2.0
if zoom#<48.0 THEN zoom#=48.0
if zoom#>128.0 THEN zoom#=128.0
position camera 0.0,zoom#*1.0,zoom#*1.0
point camera 0.0,0.0,0.0
`=== Rotate Cube ==========================================
rotateX#=wrapvalue(rotateX#+(mousemovex()*0.1))
rotateY#=wrapvalue(rotateY#+(mousemovey()*0.1))
rotate object 1,rotateY#,0.0,rotateX#
`=== Control Shader Constants =============================
set vector4 1,camera position x(),camera position y(),camera position z(),1.0
set effect constant vector 1,"EyePos",1
set effect constant vector 1,"LightDir",2
set effect constant vector 1,"LightCol",3
set effect constant vector 1,"LightAmb",4
`=== LOOP ENDS ======================================================
sync
endwhile
DGSDK:
// Paralax.cpp : The main entrypoint for the application.
//
#include "DarkSDK.h"
#include "Paralax.h"
int temp;
float zoom,camera,rotateX,rotateY;
void DarkSDK ( void )
{
//=== Initialise System ====================================
dbAutoCamOff();
dbSyncOn();
dbSyncRate(0);
dbHideMouse();
dbSetGlobalCollisionOff();
dbBackdropOn();
dbColorBackdrop(0);
dbRandomize(dbTimer());
//=== Load a Model =========================================
dbLoadObject("4Cube.x",1);
//=== Load and Apply Parallax Shader =======================
dbLoadEffect("Parallax20.fx",1,1);
dbSetObjectEffect(1,1);
temp=dbMakeVector4(1);
temp=dbMakeVector4(2);
temp=dbMakeVector4(3);
temp=dbMakeVector4(4);
dbSetVector4(2,1.0,1.0,0.5,1.0); //Light Direction
dbSetVector4(3,0.9,0.9,0.9,1.0); //Light Colour
dbSetVector4(4,0.3,0.3,0.3,1.0); //Ambient Light
//=== Pre-set Values =======================================
zoom=72.0;
camera=0.0;
rotateX=0.0;
rotateY=0.0;
// loop until the escape key is pressed
while ( LoopSDK ( ) )
{
if ( dbEscapeKey ( ) )
return;
//=== Position and Rotate Camera ===========================
if(dbUpKey()==1) ;
zoom-=2.0;
if(dbDownKey()==1)
zoom+=2.0;
if(zoom<48.0)
zoom=48.0;
if(zoom>128.0)
zoom=128.0;
dbPositionCamera(0.0,zoom*1.0,zoom*1.0);
dbPointCamera(0.0,0.0,0.0);
//=== Rotate Cube ==========================================
rotateX=dbWrapValue(rotateX+(dbMouseMoveX()*0.1));
rotateY=dbWrapValue(rotateY+(dbMouseMoveY()*0.1));
dbRotateObject(1,rotateY,0.0,rotateX);
//=== Control Shader Constants =============================
dbSetVector4(1,dbCameraPositionX(),dbCameraPositionY(),dbCameraPositionZ(),1.0);
dbSetEffectConstantVector(1,"EyePos",1);
dbSetEffectConstantVector(1,"LightDir",2);
dbSetEffectConstantVector(1,"LightCol",3);
dbSetEffectConstantVector(1,"LightAmb",4);
}
}
My specs:
CPU: OPTERON 242x2
MEMORY: DDR400 512MBx2
VIDEO CARD: GeForce 6800GT 256MB DDR3
OS: Windows XP x32-Bit and Windows XP x64-Bit
http://www.geocities.jp/acqua_studios/