high resolution (I mean REALLY high)?

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
sbornhof
Halfling
Posts: 42
Joined: Mon Aug 08, 2005 12:09 pm
Location: Paris

high resolution (I mean REALLY high)?

Post by sbornhof »

Hello everybody,

I'm thinking about printing Ogre-rendered images on real surfaces (T-shirts, wallpapers, etc). For this purpose, I need a minimum resolution of about 300 dpi.
Without doing the math, you see that on large sufaces such as posters, even a 1280*800 video-mode is by far too coarse-grained. Therefore, I wonder if it is possible to generate Ogre images which exceed the proposed video modes? Has anybody ideas of straightforward or workaround solutions?

Thank you very much!

Stefan
Gauntlet
Gnoblar
Posts: 17
Joined: Sun Apr 09, 2006 4:58 pm
Location: Austria
Contact:

Post by Gauntlet »

Screenshots are just copies of the backbuffer in most cases.
The Backbuffer has the resolution of the setted video mode. So normal screenshots wouldn't work.
You could use antialiasing, but that wouldn't help the resolution problem.

So there are 2 solutions I'm aware of:
1. Just set the video mode higher :)
2. Render-to-Texture should also work, afaik.

But the size of a texture is also limited for graphic cards, you would have to look what's the limitation for yours.

Ah, 3rd possibility: (is like an enhancement, to the former ones ;) )
Split the picture in like n screenshots, by displacing the camera, so that there is just a fraction of the whole image photographed.
Would be a bit tricky to find the right position for the camera, but should be possible.
User avatar
BenO
Goblin
Posts: 241
Joined: Mon Apr 18, 2005 5:03 pm

Post by BenO »

why don't u use an offline renderer like 3DS ? :O
Benjamin RIGAUD
Software Engineer
sbornhof
Halfling
Posts: 42
Joined: Mon Aug 08, 2005 12:09 pm
Location: Paris

Post by sbornhof »

Thanks for yor answers!

Gauntlet: Your suggestion of concatenating several screenshots is not bad, I already thought about it. But unfortunately it does not work because, by shifting the camera, objects of different distances won't shift to the same degree.

BenO: What exactly do you mean? My images are created by a simulation kernel whose results are visualized by Ogre. Can I nevertheless use 3DS for high dpi?

Stefan
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

Ogre is a real-time rendering engine.
You are better off using an off-line renderer, like Yafray or the one in Max.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
BenO
Goblin
Posts: 241
Joined: Mon Apr 18, 2005 5:03 pm

Post by BenO »

yeah, why did u choose Ogre ? :P
Benjamin RIGAUD
Software Engineer
User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Post by DWORD »

Ifr you can export the data into an offline renderer as suggested, that's probably the easiest solution. But I don't think it would be impossible to stitch together a picture from many smaller renders in Ogre. The tricky part will be to setup the camera for each part of the picture, but I think it's doable, it'll just take some math.
sbornhof
Halfling
Posts: 42
Joined: Mon Aug 08, 2005 12:09 pm
Location: Paris

Post by sbornhof »

For those who wonder why I'm asking this question:
Well, I'm simulating landscapes by growing virtual plants for my PhD. The 3D visualization is powered by Ogre. It's just that last week a businessman, seeing some screenshots, thought about the possibility of printing them out and asked me if I could extract those images in high dpi.
If after all it is not feasible, there is no real harm.

So all of you tell me that no more precision than 1280*800 is possible in straightforward ways, right? Ok, that's what I thought. Now concerning the two principal workarounds:

1) Export the data into an offline renderer: How can this be done? I'm not an expert in computer graphics, so can someone outline this procedure? Is there a method to save an Ogre scene into a file which can be reloaded by, say, 3DS?

2) Stitch together many screenshots: I'm still convinced that this does not work because far objects don't shift like near objects when the camera moves. For example, a mountain at the horizon would be visible in each screenshot. See what I mean?

Thanks again for your help!

Stefan
User avatar
Chris Jones
Lich
Posts: 1742
Joined: Tue Apr 05, 2005 1:11 pm
Location: Gosport, South England
x 1

Post by Chris Jones »

1280*800
higher than that, my monitor is at 1280x1024, and thats only because thats my monitors limit, graphics cards can do (or over, depends on your card i think?) 2048x2048? or something like that, look into your graphics cards specs
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Post by xavier »

Maximum texture size on many cards is 4096x4096. However, for OpenGL, your max render target resolution is that of the main viewport.
User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
x 3
Contact:

Post by Falagard »

I'd just take a screenshot at the highest resolution that you can based on your video card and monitor, scale it up to the dpi resolution you need and clean it up in Photoshop. Use antialiasing on the 3d card. After scaling it if it looks too blurry, add some noise. It might not be a *real* screenshot but I don't think anyone will care or notice.
sbornhof
Halfling
Posts: 42
Joined: Mon Aug 08, 2005 12:09 pm
Location: Paris

Post by sbornhof »

I think that high video modes do not properly solve the problem because I need a new order of magnitude. 300dpi for a 1m x 1m image already require 12000*12000 pixels...

Falagard: Thanks for workaround 3! I will test it.

I am very interested in the procedure of workaround 1 (export)!

Stefan
User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Post by DWORD »

sbornhof wrote:2) Stitch together many screenshots: I'm still convinced that this does not work because far objects don't shift like near objects when the camera moves. For example, a mountain at the horizon would be visible in each screenshot. See what I mean?
Yes, but the point is that you shouldn't shift the camera; let it keep the same position but change its frustum. Here's an illustration of how to do it without this problem. The original frustum is drawn in red, and one of the smaller 'screenshots' is drawn in blue.
Image
If you calculate the frustums for the different "sub"-screenshots correctly, then the final composite picture will look as it sholuld.

Depending on your scene this setup may be easier than exporting the whole thing. But regarding exporting, how do you insert the scene into Ogre? Is it made of entities (or meshes) placed at calculated positions, or is it dynamically generated geometry?
Rackle
Gnome
Posts: 375
Joined: Sat Jul 16, 2005 1:42 am
Location: Montreal

Post by Rackle »

sbornhof
Halfling
Posts: 42
Joined: Mon Aug 08, 2005 12:09 pm
Location: Paris

Post by sbornhof »

Hey DWORD, this sounds really promising! And Rackle, thanks for your link. As a matter of fact, it talks about the same idea, but unfortunately without precise explanations.

Concerning the second approach of exporting Ogre data: My images are made up of a thousand predefined meshes which have been textured, rescaled, rotated and placed into the scene. Is is possible to easily load this data collection into an offline renderer?

If not, never mind, I'll try the frustum trick!
And thanks to all for your help.

Stefan
User avatar
raicuandi
Gargoyle
Posts: 1092
Joined: Wed Nov 09, 2005 12:56 pm
Location: Adelaide, Australia
Contact:

Post by raicuandi »

If you manage to do something good, could we have this function (say, in the camera class for example) in the official Ogre code?...
sbornhof
Halfling
Posts: 42
Joined: Mon Aug 08, 2005 12:09 pm
Location: Paris

Post by sbornhof »

You're right, this is indeed interesting for everyone.
I don't have the time to directly start coding, but when I'm done, I will post my solution.

Stefan
User avatar
raicuandi
Gargoyle
Posts: 1092
Joined: Wed Nov 09, 2005 12:56 pm
Location: Adelaide, Australia
Contact:

Post by raicuandi »

sbornhof wrote:You're right, this is indeed interesting for everyone.
I don't have the time to directly start coding, but when I'm done, I will post my solution.

Stefan
Thank you! When you get something running, I can try to integrate it into Ogre! Now here's something interesting! ^^ I'm getting back on track baby! :D
sbornhof
Halfling
Posts: 42
Joined: Mon Aug 08, 2005 12:09 pm
Location: Paris

Post by sbornhof »

I thought about something:

When I set the Ogre video mode to, say, 640*480 and take a screenshot, the Ogre method "mWindow->writeContentsToFile()" saves an image including the window frame. Nevertheless, the size of the obtained png is 640*480. Can someone tell me how to take a neat screenshot without the window frame?

Stefan
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

No it doesn't. Look closer.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
raicuandi
Gargoyle
Posts: 1092
Joined: Wed Nov 09, 2005 12:56 pm
Location: Adelaide, Australia
Contact:

Post by raicuandi »

sbornhof wrote:I thought about something:

When I set the Ogre video mode to, say, 640*480 and take a screenshot, the Ogre method "mWindow->writeContentsToFile()" saves an image including the window frame. Nevertheless, the size of the obtained png is 640*480. Can someone tell me how to take a neat screenshot without the window frame?

Stefan
It only prints/saves the renderable area (actually, the front buffer I presume, but I haven't checked for sure, though I'd do it like this...). So not the frame of the window or so...
sbornhof
Halfling
Posts: 42
Joined: Mon Aug 08, 2005 12:09 pm
Location: Paris

Post by sbornhof »

Yet this is what is happening to me.

misc["border"] = "resize";
creates 640*480 images with window frames, whereas setting

misc["border"] = "none";
creates neat screenshots without frame, but they only have 632*446 pixels. I certainly overlooked an Ogre parameter to be set, but where?

Stefan
User avatar
raicuandi
Gargoyle
Posts: 1092
Joined: Wed Nov 09, 2005 12:56 pm
Location: Adelaide, Australia
Contact:

Post by raicuandi »

Maybe you've not initialised Ogre3D (you know, at startup) with the correct window size? Long shot, but I know you can resize the window at whatever size...
User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Post by DWORD »

API reference, RenderSystem::createRenderWindow() wrote:Key: "outerDimensions" Description: Whether the width/height is expressed as the size of the outer window, rather than the content area Values: true, false Default: false
So misc["outerDimensions"] = "true"; should do the trick.

Edit: Oops, that's not correct. It's the other way around, but as that is the default this is not the cause. Did you try not specifying a border? I.e. leaving out misc["border"] = ...
sbornhof
Halfling
Posts: 42
Joined: Mon Aug 08, 2005 12:09 pm
Location: Paris

Post by sbornhof »

It's solved. The external window I created had outer dimensions of 640*480, but inner dimensions of only 632*446.

Thanks again.

Stefan
Post Reply