Rendering to 60000x60000

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
alisima
Posts: 3
Joined: Fri Aug 28, 2009 10:28 am

Rendering to 60000x60000

Post by alisima »

Ok guys,

I'm using Irrlicht inside a program which (at some point) needs to do some printing.

Not regular printing, but printing on a A1/A0, which has enormous resolutions.

Back when we had only software rendering we just divided the area that needed to be printed into managable tiles (e.g. 200x200 px), starting from left-top working towards right-down.

Ok, same principal applies to a 3d render printing process. I need to divide the frustrum into smaller frustrums (tiles) and render them each seperately.

However, a problem creeps up: now each tile has its own projection, which differs from all the other ones. (and I end up with what looks like how flies see, since each eye of the fly has its own lens (i.e. projection))

I need to have the (sub)camera's (one for each tile) at different positions, yet have the same (shared) projection.

Anyone understands the problem?

Anyone knows a solution?
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: Rendering to 60000x60000

Post by REDDemon »

Most people assumes frustum view to be a cutted pyramid in wich there is a centra axis and the same angle between each plane and the axis. That's not totally true. OpenGL and I think also DirectX allows to specify arbitrary planes. (in OpenGL you can also specify directly the coordinates of each vertex of the frustum view).

Generally speaking FAR_PLANE and NEAR_PLANE are not parallel. So they can intersects themselves into a line (in standard geometry problems two planes wich are not parallel will always intersects at least in a line).

You must use a ViewMatrix/ProjectionMatrix in irrlicht for doing that, since that's the only way in the API for doing that.

Code: Select all

driver->setTransforms(ETS_VIEW, viewmatrix); 
etc...
Using a different matrix for each tile allows you to create a series of tileable frustum views. (actually your frustum views are not tiled, but are just a series of cutted piramids placed each one next to the others.)

The most simple way is to use a identity matrix (as irrlicht's GUI is doing). wich makes the viewing volume become a cube wich is strecthed on one side to fit the screen of your PC. the bad thing in this is that you lose your perspective projection and you gain a orthogonal projection scene. If you still need perspective you'd better find some tutorial on how to create a matrix, or you can just hack a bit irrlicht and use the easy-to-use OpenGL function for that.

Irrlicht API helps you a lot:
You can specify manually all 6 the planes in the SViewFrustum class, then use the class for build the matrices you need. And of course you can use the vertices of your ideal frustum view to build first the planes you need using the irrlicht's planes class. That's not as inputing directly the 8 vertices but is easy enough to do also without a deep matrix knowledge.
There are also methods in the matrix class for that.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Re: Rendering to 60000x60000

Post by omaremad »

Use an orthographic camera, that way there is no prespective shift for diffrent tiles
"Irrlicht is obese"

If you want modern rendering techniques learn how to make them or go to the engine next door =p
Fury.
Posts: 25
Joined: Mon Dec 20, 2010 2:03 pm

Re: Rendering to 60000x60000

Post by Fury. »

REDDemon wrote: The most simple way is to use a identity matrix (as irrlicht's GUI is doing). wich makes the viewing volume become a cube wich is strecthed on one side to fit the screen of your PC..
omaremad wrote: Use an orthographic camera, that way there is no prespective shift for diffrent tiles
wich is exactly the same thing ^^
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Re: Rendering to 60000x60000

Post by devsh »

try using a vertex shader which enlarges and translates (moves) every object in the scene so the window/patch sits over the right part

Or learn to use a projection matrix (premult a translation and scale matrix with the projection matrix)
60000/200=300
scaleX and Y == 300
then translate according to which patch
Post Reply