Ortho Rendering part 2

Started by OrangyTang, September 29, 2011, 06:30:27 PM

Previous topic - Next topic

OrangyTang

A resurrection/continuation of http://www.jpct.net/forum2/index.php/topic,1789.msg13178.html#msg13178

Lots of whining users means I'm looking into this (again), this time I'm going to see how much I can fake it by using a regular perspective camera with a tight fov. Questions:

1. I can't figure out how to set the near/far planes on the Camera object. How do I do this? Currently my geometry is being lost behind the far plane.

2. What's a suitable 'small' fov value to try and produce a fake-ortho view? I guess there's a tradeoff between depth buffer precision and minimising the perspective shift. Just how accurate is the depth buffer in software mode?

3. Unrelated, but how do I set per-vertex colours for geometry? None of the Object3D.addTriangle take a vertex colour. Do I have to use another method?

Thanks.

EgonOlsen

1.) It's not in Camera, it's in World (setClippingPlanes()). For the software renderer, only the far clipping plane is really relevant.

2.) I've no idea. Just try some things, but be sure to call setFOVLimits() once with proper boundaries or your changes to very small values will be ignored. Don't ask why this method exists...i can't remember that. Precision is 32bit but because it's actually a w-buffer, precision will decrease in the distance.

3.) That's easy: You can't! You can set an additional color per object but not per vertex.

OrangyTang

No per-vertex colours at all? Well that sucks, I think that makes my rendering impossible, since I need to calculate the lighting and tinting myself and that's all per-vertex.

Is there no way to fake this?

EgonOlsen


AGP

#4
Egon, since you already did a fake flat-shading thing, is there a reason not to do a "fake orthogonal" one? I'm just curious, really, since I have read a lot of questions like this one on this board.

EgonOlsen

If it would fit into the pipeline without much hassle, i would have done it already. But it doesn't and because this request doesn't come very often (i can remember two or three times in 10 years), i'll leave it as it is. Personally, i also think that orthogonal rendering is eighties and doesn't belong in a current engine...but that's just me... ;)

AGP

What if you're making a strategy game? Orthogonal rendering is very important.

EgonOlsen

I don't think so. If you are using 3D models, you should use a real 3D view IMHO. No current strategy game with 3D graphics uses an orthogonal view.