I am getting an error I have never seen before. I called it
unusual, beacuse my first time seeing it. I am trying to mess
around with evolved's deffered shader and its runs fine even when
I put my own terrain in which is also a .dbo file. As soon as I
try to texture in the same stages as he did. I get RUNTIME ERROR
7029 - 3D MEMORY ERROR AT LINE 63. Here is my code and also my
terrain. If anyone could help me through this issue it would be
more than appreciative.
`Set Up Display
set display mode 1024,768,32
sync on : sync rate 0
hide mouse
`Set Text
set text font "Verdana"
set text size 15
set text to bold
autocam off
ter = 10101
`Deferred SetUp
#include "include\deferred.dba"
Deferred_SetUp(screen width(),screen height(),512,8)
position camera 0,250,0
Deferred_SetCamera(1,250000,60)
`Post Filter SetUp
PostFilter_GlowDOFShafts(0,0,0)
`Water Setup
Water_Setup()
`Set Ambient and Fog
Deferred_SetAmbient(62,62,62,2.0)
Deferred_SetFog(255,227,214,20000*0.9)
` LOAD IMAGE "media\detail.tga", 212
` LOAD IMAGE "media\tlvt.png", 213
`load image "Media/Terrain c.png",213
load effect "FX/Terrain/Terrain Diffuse.fx",1,1:Deferred_AddEffect(1)
LOAD IMAGE "Media/terrain b.png",11
load image "Media/Terrain c.png",21
Load image "Media/Terrain n.png",31
load image "Media/rocksand.png",41
load image "Media/grass.png",51
load image "Media/rock.png",61
load object "Media/Ter.dbo",ter
scale object ter,150000,200000,150000
position object ter,0,-9000,0
`texture object ter,1,11
texture object ter,0,21
texture object ter,3,31
` texture object ter,4,41
` texture object ter,5,51
`texture object ter,6,61
set object effect ter,1
`------------------Terrain------------------------
`MAKE OBJECT TERRAIN ter ` CREATE THE TERRAINt
` SET TERRAIN HEIGHTMAP ter, "media\ter.jpg" ` SET THE HEIGHTMAP
` SET TERRAIN SCALE ter, 6, 4 ,6`14,6,14 ` SET THE SCALE
` SET TERRAIN SPLIT ter, 16 ` SPLIT VALUE BY 16 * 16
` SET TERRAIN TILING ter, 8 ` DETAIL MAP TILING
` set terrain light 90,1,-0.25,0,1,1,0.78,1000
` SET TERRAIN LIGHT ter,1, -0.25, -1,.15, .18, .29, 100 ` LIGHT - XDIR, YDIR, ZDIR, RED, GREEN, BLUE, INTENSITY
` SET TERRAIN TEXTURE ter, 213,212 ` base and detail texture
` BUILD TERRAIN ter ` finally build the terrain
`ghost object on ter
`hide object ter
` texture object ter ,0,213`
`texture object ter ,1,212
`texture object ter ,4,47
`set bump mapping on ter,47
` SET OBJECT SMOOTHING ter,75
` SET OBJECT ter,1,1,1
` SET OBJECT FOG ter,1
` POSITION OBJECT ter,0,0,0
`hide object ter
remstart
`Terrain Diffuse
load effect "FX/Terrain/Terrain Diffuse.fx",1,0:Deferred_AddEffect(1)
load image "Media/Terrain b.png",1
load image "Media/Terrain c.png",2
load image "Media/Terrain n.png",3
load image "Media/rocksand.png",4
load image "Media/grass.png",5
load image "Media/rock.png",6
load object "Media/Terrain1.dbo",1
set object effect 1,1
texture object 1,1,1
texture object 1,2,2
texture object 1,3,3
texture object 1,4,4
texture object 1,5,5
texture object 1,6,6
hide object 1
`Terrain Normals
load effect "FX/Terrain/Terrain Normals.fx",2,0:Deferred_AddEffect(2)
load image "Media/rocksand n.png",7
load image "Media/grass n.png",8
load image "Media/rock n.png",9
load object "Media/Terrain.dbo",2
set object effect 2,2
texture object 2,1,1
texture object 2,2,2
texture object 2,3,3
texture object 2,4,7
texture object 2,5,8
texture object 2,6,9
Deferred_AddTerrain(1,2)
hide object 2
remend
`Make Sky Box
` load effect "FX/Mesh/Skybox.fx",4,0:Deferred_AddEffect(4)
` load image "Media/sky box 01.dds",12,2
` make object sphere 13,-99,10,10
remstart
LOAD OBJECT "media\cielo.x",13
YROTATE OBJECT 13,180
SET OBJECT LIGHT 13,0
`43000,125000
SET OBJECT TEXTURE 13,2,1
SET OBJECT CULL 13,0
`scale object intBoxNum, 90000, 110000, 90000 ` Box will be too small without this!
`POSITION OBJECT 13, 17090,-900,28934.9980469 ` Center box i
position object 13,Camera position x(),Camera position y(),Camera position z()
Deferred_AddObject(13)
Deferred_SetObjectShadow(13,0)
`scale object 13,CameraData#(2)*2,CameraData#(2)*2,CameraData#(2)*2
SCALE OBJECT 13,8000,5000,8000
remend
load effect "FX/Mesh/Skybox.fx",4,0:Deferred_AddEffect(4)
load image "Media/sky box 01.dds",12,2
make object sphere 13,-99,10,10
Deferred_AddObject(13)
set object effect 13,4
texture object 13,1,12
Deferred_SetObjectShadow(13,0)
scale object 13,CameraData#(2)*2,CameraData#(2)*2,CameraData#(2)*2
`Make Directional Light
Deferred_MakeDirectionalLight("FX/Lighting/Directional.fx")
Deferred_RotateDirectionalLight(140,80,0)
Deferred_SetDirectionalLightShadows(1)
`Start loop
do
`Control Caera
cr#=0:cf#=0
if mouseclick()=2 then cf#=5
if leftkey()=1 or KEYSTATE(30)=1 then cr#=2
` if upkey()=1 or KEYSTATE(17)=1 then cf#=2
if downkey()=1 or KEYSTATE(31)=1 then cf#=-2
if shiftkey()=1 then cf#=cf#*2:cr#=cr#*2
cx#=cx#+mousemovey()*0.2
cy#=cy#+mousemovex()*0.2
position mouse Sw/2,Sh/2
hide mouse
Line Sw/2-5,Sh/2,Sw/2+5,Sh/2
line Sw/2,Sh/2-5,Sw/2,Sh/2+5
ncr#=curvevalue(cr#,ncr#,5)
ncf#=curvevalue(cf#,ncf#,5)
if cx#>80 then cx#=80
if cx#<-80 then cx#=-80
ncx#=curveangle(cx#,ncx#,1)
ncy#=curveangle(cy#,ncy#,1)
move camera ncf#
rotate camera 0,wrapvalue(ncy#-90),0
move camera ncr#
rotate camera 0,wrapvalue(ncy#+90),0
rotate camera ncx#,ncy#,0
`Position Sky Box to player
`position object 13,Camera position x(),Camera position y(),Camera position z()
`Set DOF
if PostDOFEnabeld=1
ob=pick object(screen width()/2,screen height()/2,1,1)
GDis#=GET PICK DISTANCE()
if Ob=0 then GDis#=100000
Focus#=curvevalue(GDis#,Focus#,20)
set effect constant float PostFrameTarget(1).FrameTargetEffect,"DOFFocus",Focus#*5
endif
`Text
ink rgb(200,200,0),0
center text screen width()/2,15,"FPS "+str$(screen fps())
line screen width()/2-5,screen height()/2,screen width()/2+5,screen height()/2
line screen width()/2,screen height()/2-5,screen width()/2,screen height()/2+5
update terrain 1
`Deferred Update
Deferred_Update()
`Water Update
Water_Update()
`PostFilter Update
PostFilter_Update()
`Sync Loop
fastSync
loop