oki doki... i'm hopeing this is now working fully

still not system to test on.
1.01.r5.Retail
RemStart
/*
Project : Tutorial Vertex Shader 1
Created : 26/06/2003 03:15:02
Author : Raven
Desc : This example is suppose to accompany the
vertex shader tutorial 1 for DarkBASIC Professional
***** Main Source File *****
*/
remend
`// error message
if get maximum vertex shader version()<1.0 then exit prompt "Error","Shaders Unavailable"
`// setup simple environment
backdrop on
hide mouse
disable escapekey
`// setup font
set text font "Arial"
set text to bold
set text size 12
`// true..false constants
#constant TRUE 0x001
#constant FALSE 0x000
`----------------------------------------------
`// Constants
`----------------------------------------------
`// stream data types
#constant VSDT_FLOAT2 0x01
#constant VSDT_FLOAT3 0x02
#constant VSDT_D3DCOLOR 0x04
`// stream fvf types
#constant VSDE_POSITION 0
#constant VSDE_NORMAL 3
#constant VSDE_DIFFUSE 5
#constant VSDE_TEXCOORD0 7
`// fvf types
#constant FVF_XYZ 0x002
#constant FVF_NORMAL 0x010
#constant FVF_DIFFUSE 0x040
#constant FVF_TEX1 0x100
`// data quad
#constant NUM_VERTS 4
#constant NUM_TRIS 2
#constant PI 3.141592653589793
`// the custom FVF format we'll need for our shader
#constant D3DFVF_VERTEX ( FVF_XYZ||D3DFVF_NORMAL||D3DFVF_DIFFUSE||D3DFVF_TEX1 )
`----------------------------------------------
`// load object variables & texture
`----------------------------------------------
global m_pQuadInstance as dword :`// Quad Instance
global m_Quad as dword :`// Quad Mesh/Object Number
global m_pVertexShader as dword :`// vertex shader number
global m_SimpleTexture as dword : m_SimpleTexture = 1
load image "DirectX5.jpg",m_SimpleTexture
m_pQuadInstance = 1
m_Quad = 1
m_pVertexShader = 1
`// create vertex buffer
global pVertexBuffer as dword
pVertexBuffer = make memory( 36*NUM_VERTS )
`// Initialize vertices for rendering a quad
`// pointer x y z nx ny nz diffuse u v
VERTEX( pVertexBuffer, -1.0,-1.0, 0.0, 0.0,0.0,1.0, 0xff00ff00, 1.0,1.0 )
VERTEX( pVertexBuffer, -1.0,-1.0, 0.0, 0.0,0.0,1.0, 0xff00ff00, 1.0,1.0 )
VERTEX( pVertexBuffer, -1.0,-1.0, 0.0, 0.0,0.0,1.0, 0xffff0000, 1.0,1.0 )
VERTEX( pVertexBuffer, -1.0,-1.0, 0.0, 0.0,0.0,1.0, 0xff0000ff, 1.0,1.0 )
`// create memblock for
make memblock m_pQuadInstance, 12+(36*NUM_VERTS)
write memblock dword m_pQuadInstance, 0, D3DFVF_VERTEX
write memblock dword m_pQuadInstance, 4, 36
write memblock dword m_pQuadInstance, 8, NUM_VERTS
copy memory get memblock ptr(m_pQuadInstance), pVertexBuffer, 36*NUM_VERTS
delete memory pVertexBuffer
make mesh from memblock m_Quad, m_pQuadInstance
make object m_Quad, m_Quad, m_SimpleTexture
delete memblock m_pQuadInstance
`// Size of Registered Data Constant
set vertex shader streamcount m_pVertexShader, 7
`{ Shader Stream Constants
set vertex shader stream m_pVertexShader, 0, VSDE_POSITION, VSDT_FLOAT3 :`// position of vertex
set vertex shader stream m_pVertexShader, 3, VSDE_NORMAL, VSDT_FLOAT3 :`// normal of vertex
set vertex shader stream m_pVertexShader, 5, VSDE_DIFFUSE, VSDT_D3DCOLOR :`// colour of vertex
set vertex shader stream m_pVertexShader, 7, VSDE_TEXCOORD0, VSDT_FLOAT2 :`// UV of Vertex
`}
`// assemble shader in the gfx card
create vertex shader from file m_pVertexShader, "simple.vsh"
`----------------------------------------------
`// Shader Constants & Matricies
`----------------------------------------------
#constant matWorld 1
#constant matProj 2
#constant matView 3
#constant vecEye 5
#constant vecLookAt 6
#constant vecUp 7
#constant vecBase 8
#constant vecLight 9
NULL=make vector4(vecBase) : set vector4 vecBase, 0.0, 0.5, 1.0, 2.0
set vertex shader vector m_pVertexShader, 0 , vecBase , 4 :`// constant shader vectors
NULL=make vector3(vecLight) : set vector3 vecLight, 0.0, 0.0, -1.0
global dwColour as dword : dwColour = rgb(128,128,196)
`{ shader setup
`// set vertex shader // from now on it'll affect this object
set vertex shader on m_Quad, m_pVertexShader
`// create matricies
NULL=make matrix4(matWorld)
`// build a perspective Projection
NULL=make matrix4(matProj)
`// to the three lines below you could alternatively just use the following line
`projection matrix4 matProj
fAspect# = screen width() / (screen height()*1.0)
build perspective lhmatrix4 matProj, PI/4, fAspect#, 1.0, 100.0
`// build a perspective view from the eye point
NULL=make matrix4(matView)
`// to the five lines below you could alternatively just use the following line
`view matrix4 matView
NULL=make vector3(vecEye) : set vector3 vecEye, 0.0, 1.0, -4.0
NULL=make vector3(vecLookAt) : set vector3 vecLookAt, 0.0, 0.0, 0.0
NULL=make vector3(vecUp) : set vector3 vecUp, 0.0, 1.0, 0.0
build lookat lhmatrix4 matView, vecEye, vecLookAt, vecUp
`}
`// base for the timer to count from
global BaseTime as float : BaseTime = timer()*1.0
`// main loop //
do
if escapekey()=TRUE then goto Quit
`{ Shader
`// set shader constants
multiply matrix4 matWorld, matWorld, matProj
multiply matrix4 matWorld, matWorld, matView
set vertex shader matrix m_pVertexShader, 4 , matWorld, 4
set vertex shader vector m_pVertexShader, 8 , dwColour, 1
set vertex shader vector m_pVertexShader, 12, vecLight, 4
`}
`// use the world matrix to rotate the object
world matrix4 matWorld
rotate y matrix4 matWorld,wrapvalue((timer()-BaseTime)*4.0)
transpose matrix4 matWorld, matWorld :`// finalise the world for use // always set last
loop
`----------------------------------------------
`//
function VERTEX( pVertex as dword, x as float, y as float, z as float _
nx as float, ny as float, nz as float _
diffuse as dword, u as float, v as float )
`{
`// position
*pVertex=x : pVertex=pVertex+4
*pVertex=y : pVertex=pVertex+4
*pVertex=z : pVertex=pVertex+4
`// normal
*pVertex=nx : pVertex=pVertex+4
*pVertex=ny : pVertex=pVertex+4
*pVertex=nz : pVertex=pVertex+4
`// colour
*pVertex=diffuse : pVertex=pVertex+4
`// texture coords
*pVertex=u : pVertex=pVertex+4
*pVertex=v : pVertex=pVertex+4
endfunction
`} void
Quit:
`// place last minute deletions here
set vertex shader off m_Quad
delete vertex shader m_pVertexShader
`// delete matricies used
NULL=delete matrix4(matWorld)
NULL=delete matrix4(matView)
NULL=delete matrix4(matProj)
`// delete vectors used
NULL=delete vector3(vecEye)
NULL=delete vector3(vecLookAt)
NULL=delete vector3(vecUp)
NULL=delete vector3(vecLight)
NULL=delete vector4(vecBase)
end
remstart
/*
Copyright© 2003 Robert Lettan, FMTau Labs LLC. All Rights Reserved.
Version 1.01.r5.Retail
*/
remend
simple.vsh
// Shader version 1.0
vs.1.0
// emit project x y z w
dp4 oPos.x, v0, c4
dp4 oPos.y, v0, c5
dp4 oPos.z, v0, c6
dp4 oPos.w, v0, c7
// N dot L in world space
dp3 r0, v3, c12
// Calculate color
mul oD0, r0.x, v5
// copy texcoords
mov oT0.xy, v7
hopefully it is all working now... although one beta testers system is totally messed up (not the fault of the shader though

) and the other is too lazy to get off his laptop to try it lol
I pride myself that i don't kill...

well not without a good reason