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.

Newcomers DBPro Corner / Strange lighting issue and camera issue

Author
Message
Kieran
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 7th Apr 2010 14:56
Well the lighting issue is simple. Before, the lighting was normal, now it is very intense on the player, making it fully white, and showing only the proper color when in shadow. Hiding light #0 (I assume the auto light) fixes it, but then there is no lighting at all on the player. I would highly appreciate it if anyone has a fix for this.

The camera issue is a little strange. I decided to disable the autocam and use my own camera so DarkBASIC wont do whatever it pleases to my camera. However, it lags. I'm not sure why, but it lags where the autocam doesn't, so for now I am sticking with the autocam unless someone knows why.

Thanks in advance for the help. It is greatly appreciated.
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 7th Apr 2010 15:32
Something like that use to hapens when we scale to much the object less than its original size...for example, if we export from an external editor and then we realize that the object is to big, what we first do is just scale the object to smaller size with scale obect my_obj,50,50,50.So it is better to adjust the object in our fovorite 3D program and then export in its proper size for our game.

I prefer to autocam off, but in your case I donĀ“t know what you have....a piece of code would be great to guess your problem.

cheers.

I'm not a grumpy grandpa
Kieran
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 7th Apr 2010 16:32
You were right about my object being scaled down. So I removed the code that made it smaller and edited it in blender, but the problem is still there.

As for the camera, here is some code.

No Lag:


Lag:
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 7th Apr 2010 18:30
Concerning the light, try

This will make the default light a mid-grey, and I think the default is pure white RGB(255,255,255).

For the camera - I don't understnad why you need to call "make Camera 1". DBPro already has a camera that you can control freely (Camera 0). Autocam On/Off simply repositions camera 0 so that you can see your entire object the second its loaded.

I think if you try this:

the lag should disappear, since DBPro only has to worry about drawing one camera instead of two (i.e camera 0 instead of camera's 0 and 1).

If by "lag", though, you mean the camera is slow to reposition to the back of the object, try decreasing the "Smoothing" parameter from 5 to about 2 or 3.

Hope this helps!

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 7th Apr 2010 23:25
As to the lighting try to set object specular and emissive to zero (see the DBP help)
In your modeler,you may have used a material with high specular and emissive values.
cheers
Kieran
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 8th Apr 2010 02:00
@Robert the Robot

I did not realize that camera 0 was still active when autocam was off. Thanks for that. The smooth value is not what I considered lag. The lag was a low framerate. The code you suggested worked perfectly. Thank you. However, changing the light to gray did not do anything. It still appears very bright.

@Scorpyo

I still want lighting on the player, just not as much. I did not use a material like that though, but thanks for the suggestion. My only other idea is to texture bake the player like I did with the static objects in the game, but I fear it wont look as effective as it is a moving object.
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 8th Apr 2010 19:36
It could very well be your object - I think you mentioned making it in Blender? I'm not familiar with the program, but see if you can reduce the object's normals.

They're vectors at right angles to every face on the object - the bigger the vector (the longer the line shown in blender) then the more strongly a light will illuminate that face. That could be what's making the object look burnt out.

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 9th Apr 2010 02:15
@Kieran

This problem about object very bright, use to hapens as well, when we make the object to small, even in an external editor. To have references on how big your model would be with correct aspect in real world, a good idea, is to make a box in your 3D program 100,100,100 cm , so the box is 100 cm by 100 cm by 100 cm then try to make your model as if it is 1.8 meters hight...that means 180 cm hight. So lights in dark basic, will illuminate the object as a real light ...no so bright, and no so dim.

cheers

I'm not a grumpy grandpa
Kieran
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 9th Apr 2010 04:31
@Robot the Robot

I don't think that is the problem. All my other models are made in blender as well and they work fine. It could be though.

@Chafari

Ok, I will try that out.

Login to post a reply

Server time is: 2024-11-23 17:16:32
Your offset time is: 2024-11-23 17:16:32