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 Discussion / Rendering problem

Author
Message
3D Ministry
18
Years of Service
User Offline
Joined: 24th Jul 2006
Location:
Posted: 24th Jul 2006 19:38
I'm using DBC expanded on a 2.2 ghz CPU, 1.5 gigs RAM, Gforce 6600/128 mb machine.

Here's the situation. I'm using models that I made to remake an old boardgame. The models are made using Maya 5.0 and a .x format exporter plug-in. The gameboard is made of 12 pieces, each 6x6 tiles. This is because I scanned in the texture and had to do it in sections. The gameboardsegment model was oriented before export so that the playing surface is on the 0y coordinate. That way any models added will automatically rest upon the playing surface without any adjustments. The goblin model in the pix was made in 2 seperate pieces. The goblin and the base. These 2 pieces were "combined" in maya before export. This means that maya counts them as the same model, but their geometry is not physically connected. This way, the model can be animated while the base remains still.

Here's the problem. As the camera moves away from a model on the table, the model starts to disappear starting with the base and working up. It's a horribly ugly effect and therefore unacceptable.

Here's the code and a pic of the problem area up close/far away so you can see what's going on...

http://img375.imageshack.us/img375/9779/goblinrednerproblem02ea5.jpg
http://img441.imageshack.us/img441/4500/goblinrednerproblem01py2.jpg


What's going on? How can I fix this? Any help would be most appreciated!
RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 24th Jul 2006 23:32
From what I can see that happens with plains sometimes, try extruding the bottom of the plain downwards to form a box. It'll add a few poly's yes, but It should also fix the problem. There might be a command to fix this I just cant recal, still worth a try with the extruding technique.


Projects: Online CTF Game | Newcommer's Guide to FPS's
Zach
22
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: Ms, USA
Posted: 25th Jul 2006 02:40
you might also try setting your camera's range to a greater distance.

Tupelo, Ms
Captain America
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 26th Jul 2006 05:35 Edited at: 26th Jul 2006 05:37
This exact thing has happened to me before also!

I fixed it by doing a combination of the above.

I first set the camera's range so that it could see farther.
Then I made the bottom of my model 'a sphere on a base like yours'
alot thicker and it worked fine.

Granted I did not pull the camera extremely far away, but I think that this should solve your problems, and if it does not then I hope you can figure out something else.

Cheers!

Cap'n


Cheers,
Capt. America
3D Ministry
18
Years of Service
User Offline
Joined: 24th Jul 2006
Location:
Posted: 27th Jul 2006 14:20
Thanks for the help, I'll be sure to let you know if any of this solves my problem. Both the model's base and the gameboard model are very thin, so I'll try making them thicker. I did try a camera range of 10,000 and still received the same effect. Perhaps it takes both like you say.

I'll mess around with it a bit more and let you all know how it turns out.
3D Ministry
18
Years of Service
User Offline
Joined: 24th Jul 2006
Location:
Posted: 15th Aug 2006 12:36
After hours of work I still cannot solve the problem. I increased the camera view distance, made the board thicker, tried making the models a larger scale, I even tried importing them as .3ds instead of .x , and so far I get the same results.

I havn't tried making the bottom of the base spherical as captain america suggests, but it's the next thing I'm going to try.

I did notice that if the model is physically attached to the base then there is no problem. It appears that the problem occurs when 2 seperate models are relatively close to each other.

I also went through all the help files and couldn't find any command that would fix it.

So I'm going to try and make the board in DB, instead of importing it. Then I'm going to make some changes to the structure of the model and see if I can get better results. I'll post my findings here in case anybody else has the same problem.

Captain America, I would like to know more about how you solved the problem in your case. Any details you could share would be greatly appreciated as it seems that you're the only other person to encounter this personally. If you dont want to disclose private info here, please email me. [email protected]

If anyone has any other ideas on how to solve this, I'm open to suggestions. Until I figure this out, I can't really do any more work on the project. Thank you.
Captain America
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 16th Aug 2006 07:34
well im not sure on how to help you anymore, I stated what I did above, and it fixed the problem for me. too bad I changed computers and didnt save that, I could have given you my source code.

ummmm.... the only thing I can think of is that you have to attach the model to the base.

but other than that Im not really sure of how to help.

Hope your problem gets solved easily!

Cheer's

Cap'n


Cheers,
Capt. America
Slayer93
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 16th Aug 2006 08:18
It looks like there are two faces at the exact same spot so what ever you want visible you should probably move up by a fraction something like 0.1 or something. Hope that can slove your problem

Naruto is the ninja...not really

Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 16th Aug 2006 12:04
Quote: "It looks like there are two faces at the exact same spot so what ever you want visible you should probably move up by a fraction something like 0.1 or something. Hope that can slove your problem"


I give the same advice, and out of my experience, it always worked.

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Aug 2006 13:15
Couple of things you may want to check:

Check your model in your modeling program and make sure you have your normals calculated/set up correctly for export. If there's a recalc function, you may want to try it.

In DarkBASIC, try turning on and off the CULLING and move the camera around. What you're describing sounds like it might be a culling effect - which can be a function of how your normals are set, and whether or not you have it on or off in DBC.

If you have the patience, and assuming these files are ascii, check the .x file(s) you exported and look for a heading labeled Material <some name> {. Depending on how many colors and/or image textures you use, there could be several. Where ever you use an image, there should be a sub-heading TextureFileName { <name of your bitmap>. If the filename of an image is included in this .x file, and you are manually loading in the same texture for the same object in DBC, this may cause a problem. I don't think it should, it would just eat up memory - but it may be something to check.

Enjoy your day.
3D Ministry
18
Years of Service
User Offline
Joined: 24th Jul 2006
Location:
Posted: 18th Aug 2006 14:04
Thanks for the extra help. I wanted to avoid attaching the model to the base because I may want to animate it later, but if that's the only way, I think it'll work.

Now that you mention it, I think all the affected areas are overlapping polygons. I'll make a few slight adjustments and see if that clears it up.

If none of that works, I'll try Latch's idea, but I have a feeling that the above will solve the problem. I'll be sure to let you all know, and many thanks again!
3D Ministry
18
Years of Service
User Offline
Joined: 24th Jul 2006
Location:
Posted: 18th Aug 2006 15:45
Dang, this is really discouraging. The problem occurs anywhere that 2 polygons facing the camera are just near each other (like within 5-6 units). Apparently they dont need to be overlapping to achieve this effect. I even tried physically attaching the base to the model and received the same results.

So I went through Latch's checklist. I checked the surface normals and everything is correct there. I'm not sure if DBC supports Culling. If so, it's not in the help file and I cannot guess the context (like "set culling on"). If you know the correct context, let me know.

I opened the .x file and found the heading you described. I did have the same image in the file as the one I was applying within DB. I skipped the "texture object" step and found it doesn't need it, but the problem is still there.

I think I'll export the model into another game engine and see if there's anything wrong with it there (like Unreal). If there's a problem there, then I know it's the model and not DB. But if it renders fine there it doesn't really proove anything. If anybody has any more ideas, I really appreciate the help.
Captain America
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 19th Aug 2006 00:06
sorry i couldnt help you.

hope everything works out!


Cheers,
Capt. America
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 19th Aug 2006 00:37 Edited at: 19th Aug 2006 00:51
for culling use the SET OBJECT command and change the control of the fourth item:

SET OBJECT <object number>,<wireframe>,<transparency>,<cull>

Try these numbers (substitute the actual object number you've assigned to the mesh for <object number> :

SET OBJECT <object number>,1,1,0

Then move your camera around and see if the effect changes.

Then try

SET OBJECT <object number>,1,1,1

And move the camera around...

Hope it helps!

[edit]

try messing with the mipmap modes:

SET MIPMAP MODE <0,1,or 2>
0=off ; 1=point; 2=linear mipmap mode

Normalization:

SET NORMALIZATION ON

SET NORMALIZATION OFF

Enjoy your day.
SFSW
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 19th Aug 2006 00:55
That's a common problem with many 3D engines that can occur as you get farther away from two surfaces that are very close together. You have a couple of options.

First, you can place the green goblin higher above the board. If your camera system never passes below the goblin object, then it will still appear to be in contact, or nearly in contact, with the surface of the board. Depending on how high you allow your camera to get, the elevation will need to be anything from about 0.2 above where you are at now up to 1.0-2.0 full units above.

Another option is increasing the scale of the environment you created. Instead of using the default scale, increase everything with scale object X,200,200,200 and try again. If not enough, increase the scale further. One and/or both options usually fixes the problem and I'd recommend just raising the elevation of your goblin object first.

Very nice looking graphics by the way!

Login to post a reply

Server time is: 2025-05-25 08:28:11
Your offset time is: 2025-05-25 08:28:11