Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Runtime Error 7029 - 3D Memory Error at line####

Author
Message
htooaung
8
Years of Service
User Offline
Joined: 8th Dec 2015
Location: Myanmar
Posted: 21st Jan 2016 08:24
Hi , I'm DarkBasic Begineer .
I try to test terrain with flashlight . But I get that error "Runtime Error 7029 - 3D Memory Error at line " why I got this error .I don't understand .Please help me .This is my [/
set display mode 1024,768,32
color backdrop rgb(0,0,0)
backdrop on
autocam off
sync on
sync rate 30

global Brightness as float
global Light as float
position camera 0,4,-50
point camera 0,0,0

load image "media/spotlight.png",5
load effect "FX/FlashLight.fx",6,0
load object "TerrianWithLimb/TerrainwithLight.dbo",1
set object effect 1,6
texture object 1,2,5

`Brightness
Brightness#=0
Light=0

`Light Vectors
Global ActiveLights
r=make vector4(1)
r=make vector3(2)
r=make matrix4(3)
r=make matrix4(4)
r=make vector3(5)
r=make vector3(6)
r=make vector3(7)

do

Control camera using arrowkeys 0,0.5,0.5
if KEYSTATE(33)=1 and NoPressF=0 and Light=0 then Light=1:NoPressF=1
if KEYSTATE(33)=1 and NoPressF=0 and Light=1 then Light=0:NoPressF=1
if Light=0 then Brightness#=Brightness#-0.1
if Light=1 then Brightness#=Brightness#+0.1
if Brightness#>4.0 then Brightness#=4.0
if Brightness#<0.0 then Brightness#=0.0
set effect constant float 6,"BrightNess",Brightness#
if KEYSTATE(33)=0 then NoPressF=0
if Brightness#>0.0
set vector4 1,camera position x(),camera position y(),camera position z(),0
set effect constant vector 6,"LightPosition",1
angX#=curveangle(camera angle x(),angX#,4)
angY#=curveangle(camera angle Y(),angY#,4)
rotate x matrix4 3,wrapvalue(angX#)/57.3
rotate y matrix4 4,wrapvalue(angY#)/57.3
multiply matrix4 3,3,4
set vector3 2,0,0,1
transform normals vector3 2,2,3
set vector3 5,0,0,0
set vector3 6,x vector3(2),y vector3(2),z vector3(2)
set vector3 7,0,1,0
build lookat lhmatrix4 3,5,6,7
build fov lhmatrix4 4,1,1,1,5000
multiply matrix4 3,3,4
set effect constant matrix 6,"LightProjMatrix",3
endif
if scancode()=0 then NoPress=0
Update_DynamicLights()
sync
loop
end

Function Set_DynamicLight(LposX#,LposY#,LposZ#,ColR#,ColG#,ColB#,Range#)
ActiveLights=ActiveLights+1
if ActiveLights>6 then ActiveLight=6
set vector4 1,LposX#,LposY#,LposZ#,0
set effect constant vector 1,"LightPosition_"+str$(ActiveLights),1
set vector4 1,ColR#/255,ColG#/255,ColB#/255,0
set effect constant vector 1,"LightColor_"+str$(ActiveLights),1
set effect constant float 1,"LightRange_"+str$(ActiveLights),Range#
Endfunction
`----------------------------------------------------
Function Update_DynamicLights()
set effect technique 6,"Light"+str$(ActiveLights)
ActiveLights=0
Endfunction]


And this is my terrain.I create this terrain as dbo format.

[/code
set display mode 1024,768,32
color backdrop rgb (0,0,0)
backdrop on
autocam off
sync on
sync rate 60
global X as integer
global Y as float
global Z as integer
global cx as float
global cy as float
global cz as float
#constant T 1 `make terrain

position camera 1566,7,1880
point camera 0,0,0
Create_Terrain_Limb()
do
control camera using arrowkeys 0,5,1
text 50,50,str$(camera position x())
text 50,60,str$(camera position y())
text 50,70,str$(camera position z())
`save object "TerrainwithLight.dbo",1
sync
loop
end

function Create_Terrain_Limb()

#constant MesTer 1
#constant rootobj 1
xscale#=12: yscale#=1.0: zscale#=12
make object terrain 1 ` create the terrain object
set terrain heightmap 1, "map.bmp" ` set the heightmap
set terrain scale 1, xscale#, yscale#, zscale# ` set the scale
set terrain split 1, 16 ` split value by 16 * 16
set terrain tiling 1, 16 ` detail map tiling
set terrain light 1, 1, -0.25, 0, 1, 1, 0.78, 0.5 ` light - xdir, ydir, zdir, red, green, blue, intensity
set terrain texture 1, 1, 2 ` base and detail texture
build terrain 1 ` finally build the terrain
set object filter 1,2

load image "terrain/grass1s.png",1
make mesh from object MesTer,1
delete object 1
make object sphere rootobj,0
add limb 1,1,MesTer
texture limb 1,1,1
set object normals 1
endfunction]

Please help me ,explain me and teach me .Sorry for my poor English Skill.
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 22nd Jan 2016 11:00
It would be helpful to know the line number, ajem

Other than that we can just guess.
These kind of errors can arise when you perform an action over a resource that doesn't exist and such (for example, not loaded textures, objects, shaders, ...)
htooaung
8
Years of Service
User Offline
Joined: 8th Dec 2015
Location: Myanmar
Posted: 25th Jan 2016 03:06
Thank Morcilla.
Yes ,[quote=It would be helpful to know the line number] line number is 21.
this line "set object effect 1,6".
[quote=These kind of errors can arise when you perform an action over a resource that doesn't exist and such (for example, not loaded textures, objects, shaders, ...)]
Yes,I check it but It certain loaded. My object is terrain obj as dbo format . When I set flashlight effect to object(TerrainwithLight.dbo) ,i got this error "Runtime Error 7029 - 3D Memory Error at line21".
If i don't set effect to object ,it is ok.I got nothing error.But i want to set effect to obj(TerrainwithLight.dbo).
How i can fix it .
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 25th Jan 2016 10:16
It seems that the effect "FX/FlashLight.fx" has not been loaded or either it does not compile at run time.
Maybe it is not prepared for DBPro. Test the effect file with a simple isolated object.
There was a way to get the shaders compile errors dumped, but I dot have the documentation at hand sorry.


htooaung
8
Years of Service
User Offline
Joined: 8th Dec 2015
Location: Myanmar
Posted: 26th Jan 2016 04:30
Thank Morcilla.
when I change my code i get this style
[img]null[/img][img]null[/img]
But Terrain is mix with Flashlight texture

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-26 21:24:40
Your offset time is: 2024-04-26 21:24:40