Page 1 of 1

DETAILED scene rendering to jpg/gif

Posted: Sat May 07, 2005 5:05 pm
by ZombieWoof
I've been offered a chance to do an application that will display photo-realistic scenes, and I need to check my concepts before I commit to the project ;)

In general, I'll be required to do rooms with windows and furniture, with the textures on the walls, floor, furniture and other scene elements able to be selected at runtime, and the results rendered to a file on disk.

The scenes are static.. nothing is moving around, and once textures are assigned, I just need to render the scene once, then move on to another scene/texture combination and render that one, and so on......

here are my questions:

1. since the scenes are static, with little or no reflective elements, can I ligtmap the scene ONCE no matter how I change the textures applied to the models ??

2. are there any issues with changing the textures assigned to a mesh at runtime ??

and 3. I presume that render-to-texture will be used.. can someone stick up a code snippet for putting that rendered texture to a file on disk ??

Any other suggestions appreciated !!

Posted: Sat May 07, 2005 8:11 pm
by P
1 :

In fact for the lightmap i see 2 possibilities :

A : you consider the lightmap is a simple one, this way you can use the same lightmap for all the differents combinaison of textures appied to the scene. So yes only 1 lightmap for several texture combinaisons, which is applied using multitexturing.

B . you consider the lightmap is an advanced one, which is what you ll probably need if you want a photorealistic rendering.
The lightmap which is rendered into your 3D soft will here take care while rendering it (into blender for exemple), of almost all the surfaces parameters ( like color, diffusion, microbumps, reflection, specularity etc.... ) . In fact almost all surface parameters will have an impact on the generated lightmap. So to sum up, if you have planned to play with complex surface parameters into the 3D soft and really want to achieve a photorealistic rendering, you ll have to generate 1 lightmap per scene, and per texture combination.

If you are using lightmaps i assume even the lights are static. Why not rendering the lightmap and the surface color into only 1 surface ? In fact rendering all into one (or severals) texture(s). If you want a photrealist rendering, your lightmap will have to be i think the same resolution of the base texture applied to the scene.

But if you have planned to make textures repeat instead of using a global one for the whole scene (in order to reuse textures) you can use 1 uv for the color textures, and 1 for the lightmap which will be a global one. And you will blend them at realtime using multitexturing.

2. i don t know.

3. i m not sure to see the need of render to texture here. For reflections ? For rendering the scene to the texture which will be exported ?

( i may be wrong on several things and my englih not enough good to explain well. Anyway what you are trying to do covers a HUGE area of discussions )

Posted: Sat May 07, 2005 8:18 pm
In addition to what P wrote:

2: That's no problem.

3: I'm sure this has been done, but I don't know how. I think maybe there's a topic here on the forum describing how to do it.

Posted: Sat May 07, 2005 9:06 pm
by ZombieWoof
huge ?? I hope not

ok.. simple example: a room with a bed, a chair, and a table... I want to be able to have one texture on the bed cover , another on the chair fabric (from a jpg or tiff, no fancy materials involved at all, no bump maps or specularity, or if complex materials are used, they are the same no matter which texture is applied)

default textures for the wall, table, floor, etc would already be in place (and possible to be modified before rendering just like any other texture in the scene)

having assigned these textures.. I want to render it out to high res JPG and deliver the rendering to a web browser .. and this has to happen in a matter of seconds... at most a minute from the time a scene/texture combo is requested, until the rendered image is shown in the browser.

I had thought that lightmapping was just an additive effect on the texturing, controlling the per-pixel brightness without regard to the actual texture .. am I even close here ??

Posted: Sat May 07, 2005 9:48 pm
by P
Well when i said huge i was thinking about the photorealistic rendering of a scene. It s a huge topic in non realtime 3D and probably even more huge in realtime 3D. You can do what you are speaking about, keeping it in a simple way, but you'll not get a photorealistic rendering. Just saying it again cuz it seems it was your goal, but i understand now you were speaking about a good lighting effect instead of photorealism.

You are right, lightmaps are only a per-pixel brightness effect, but they can be colored too, cuz lights are not always white. I m not sure about what you mean by additive, here i think it s a multiply operation of the color texture with the lightmap one.

( again i may be wrong, i m not experienced... )

Posted: Sun May 08, 2005 6:54 am
by Vectrex
well if it's just a static photo scene couldn't it be a 2d picture with alpha to show through to the texture (alpha could take shadows into account). Then behind the alpha part just have some primitive shapes that generally follow the perspective of the object and change that. Makes for easy picking and texture changing :) In fact you could do that in Flash :twisted:

Posted: Sun May 08, 2005 7:21 am
by ZombieWoof
ohh no -- definitly 3D and must be able to render same scene from different camera points

though I guess it could be done with shockwave 3d.. but not with near as good a quality

Posted: Thu May 12, 2005 2:54 am
by sevensevens
If you want photo realism, you probably end up writing your own functions and classes for refractions, photon mapping, ect. If you want to see what you're getting into, Pov-Ray( seems similar to what you might be doing.

Posted: Thu May 12, 2005 10:33 am
by P
There are a very good Raytracing engine which is called yafray

Maybe look at it, if you want to use this kind of stuff you ll not be able to do realtime rendering, it ll take more time, mostly depending on the final quality

Posted: Fri May 13, 2005 3:53 am
by ZombieWoof
its looking a lot like the customer wants raytracing quality, but exactly what they are asking for is that it not look cartoony.... but thats more an issue of models and textures rather than rendering system

the scenes are fixed, so the only things that change are the materials/textures

raytracing is overkill if thats all thats changing.... good models and a detailed high res lightmap should be able to handle the situation.

or am I outa my flippin' mind ??

Posted: Fri May 13, 2005 4:13 pm
by RoundSparrow
I think rendeirng / raytracing is the only way to get really good results.

Particularly on edges, Ogre has a hard time and depends on hardware AA from what I've seen... An offline "slow renderer" like Blender does a much better job.

Are you just doing this once and capturing the output? I would consider a good 64-bit system, maybe even multiple CPU's... depends how much you are working / developing on it :) Or some type of distributed system.

If you are serious about this project we are also looking into this. If we can match up ogre world coordinates with an offline renderer to produce the same scene. Contact me...

Posted: Fri May 13, 2005 4:37 pm
by ZombieWoof
this is for an on demand one-shot service -- external app will pass in the scene id and a list of material/texture settings to use for the render, and get back a single image to be displayed to the user

even if it were raytraced, required delivery rate doesnt require more than a dual xeon system... if It can be done with ogre.. there is no reason that he system cant deliver an image every second easily :)

just to go over it one more time -- a scene, likely with upwards of 100k verts (high poly models) that will get loaded once, its materials set from external input, and rendered once at high resolution (1024x768 or better), then the materials changed, render again, and so on

frame rate is not an issue -- if it took 5-10 secs to render, it wouldnt bother me at all... but I seriously doubt that would happen if the vid card is up to handling that detailed a scene.... and the higer end cards do millions of verts per second