Draw distance?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
pyro9219
Posts: 14
Joined: Mon Aug 29, 2005 2:10 pm
Location: Portland, Oregon

Draw distance?

Post by pyro9219 »

I've got a rather large FPS world I'm working with using the default FPS camera, as well as a Quake 3 map. I can see down the far ends of some parts and see my skybox at large distances, but as I close the gap the walls for the quake 3 map will draw in. Is there a fix?
Elise
Posts: 48
Joined: Tue Jul 19, 2005 6:30 am
Contact:

Post by Elise »

Camera->setFarValue ();

The default is 2000.0f I believe, so try something higher than that.
pyro9219
Posts: 14
Joined: Mon Aug 29, 2005 2:10 pm
Location: Portland, Oregon

Post by pyro9219 »

for c#?

cam.FarValue(3000);
or maybe a smaller number?
pyro9219
Posts: 14
Joined: Mon Aug 29, 2005 2:10 pm
Location: Portland, Oregon

Post by pyro9219 »

I got it, nevermind! Thanks! (4000 did the trick!)
GX

Post by GX »

Don't go overboard on your FAR setting! this WILL affect your Z-Buffer granuality and causes z-fighting and other artifacts on CERTAIN scenes if you push t.

Instead... if it is not just a q3 map port - try and scale down your meshes and movement speeds and you can use SMALLER far values which will remove artifacts from cheapo 16 bit buffers.
pyro9219
Posts: 14
Joined: Mon Aug 29, 2005 2:10 pm
Location: Portland, Oregon

Post by pyro9219 »

at this point, the only loaded item I have is a Q3 map, I've been playing with controls and whatnot. This is mostly just for a fun way to learn C# for me.

I'm interested in scaling the mesh down, if you would be willing to point me in the right direction. I've already had to make the FPS node smaller, since in the 2nd demo (quake 3 map) the node is to tall to go under the platform things, and almost dwarfs a door.

Thanks for the support! This community has really been an excellent help and I hope to soon know enough about the engine to help people with the .NET end.
Elise
Posts: 48
Joined: Tue Jul 19, 2005 6:30 am
Contact:

Post by Elise »

To scale scenenode:

node->setScale(core::vector3df(1, 1, 1));

Node is the Q3 level scenenode in this case. Set the values lower than one to make the node smaller, f.ex. (core::vector3df(0.5f, 0.5f, 0.5f) to make it half size.
If you are going to scale the node really small, you might want to set the material flag 'NormalizeNormals' to avoid problems. Do it with:

node->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);


You can also scale the mesh directly with the mesh manipulator:

irrSceneManager->getMeshManipulator()->scaleMesh(Q3LevelMesh->getMesh(0), core::vector3df(0.5f, 0.5f, 0.5f));

Sorry that's all in C++, don't know much anything about C#. :(
elander
Posts: 193
Joined: Tue Oct 05, 2004 11:37 am

Post by elander »

You can have the far value you want, there is no restriction about that as long as you keep the formula far_value/near_value <= 2000. The value 2000 is just a number that works well for 16bit zbuffers. For 24bit zbuffers this value can be much bigger. I haven't tried yet but i think you can set Irrlicht engine to use a 24bit zbuffer and then you can use a much bigger limit than 2000.
pyro9219
Posts: 14
Joined: Mon Aug 29, 2005 2:10 pm
Location: Portland, Oregon

Post by pyro9219 »

I'm not sure exactly how your translation of 2000 would crowd a 16bit integer or memory address(perhaps background math done by the graphics engine that the 2000 represents?), but I do know that I'm running just fine on both my 128mb 9600XT and my geforce2 mobile 16mb card in my laptop. Laptop gets over 60fps currently with 4500 as my value in 1024x768

I think I'll see about scaling eitherway though.
pyro9219
Posts: 14
Joined: Mon Aug 29, 2005 2:10 pm
Location: Portland, Oregon

Post by pyro9219 »

node.Scale.Set(0.05f, 0.05f, 0.05f);

That doesn't change anything but seems to be what you were refering to about scaling the Q3 map file. :/
Post Reply