Author Topic: Ortho Rendering part 2  (Read 2860 times)

Offline OrangyTang

  • byte
  • *
  • Posts: 5
    • View Profile
Ortho Rendering part 2
« on: September 29, 2011, 06:30:27 pm »
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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12297
    • View Profile
    • http://www.jpct.net
Re: Ortho Rendering part 2
« Reply #1 on: September 29, 2011, 08:39:56 pm »
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.

Offline OrangyTang

  • byte
  • *
  • Posts: 5
    • View Profile
Re: Ortho Rendering part 2
« Reply #2 on: September 29, 2011, 09:40:43 pm »
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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12297
    • View Profile
    • http://www.jpct.net
Re: Ortho Rendering part 2
« Reply #3 on: September 29, 2011, 10:50:49 pm »
Is there no way to fake this?
None that i can think of ATM... :'(

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Ortho Rendering part 2
« Reply #4 on: October 02, 2011, 08:15:47 am »
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.
« Last Edit: October 02, 2011, 08:25:38 am by AGP »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12297
    • View Profile
    • http://www.jpct.net
Re: Ortho Rendering part 2
« Reply #5 on: October 02, 2011, 09:12:19 pm »
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... ;)

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Ortho Rendering part 2
« Reply #6 on: October 28, 2011, 07:44:57 pm »
What if you're making a strategy game? Orthogonal rendering is very important.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12297
    • View Profile
    • http://www.jpct.net
Re: Ortho Rendering part 2
« Reply #7 on: October 28, 2011, 10:26:51 pm »
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.