"reflecting" windows in buildings

Paulov

21-12-2006 10:24:51

Hi

Looking videos from Project Gothan I´ve seen a dettail that gives a very nice effect, is that the windows in the buildings "have reflections", well, surely enviroment maps. May be they´re realtime since the cars have realtime reflections, but I think that for such a number of windows and being a racing game they´ll be simple enviroment maps.

Well how do you think I could do them?

I think this could be the way. (only orientative)

Make an alpha for the facade so that the windows are covered in black.
Create a material in a single pass similar to the one in the env map tutorial, having as first texture unit the one commented before and as second the texture of the sky or enviroment.
(may be instead of black the alpha should be gray so that original windows information is kept and the reflections are not so strong)

would this work? would you do in another way?

Paulov

22-12-2006 23:00:30

Hi,
I´ve been doing tests, but I´ve not been able to get more than aproaches to the desired effect. I´ve been near, but allways the rest of the faccade was showing some reflections (env map)

This image shows how I´ve prepared the alpha in photoshop.



Would apreciate a lot if someone could gide me on how to set the configuration of the material so I can have only reflecting windows.

You can download the texture of the facade in .TGA from here:
www.ikernor.com/download/ogre-forum/ofu ... ristal.tga

as env map texture you can use this one:
http://twofeetin.typepad.com/photos/unc ... set2_1.JPG

thanks

PAblo.. . .

Lioric

23-12-2006 16:19:21

You can download the windows/glass example in the "Scenes" section of the "Artist's Center"

In that example, the glass has a different material id to apply the effect, but if you need to use same material for all of your object, you can use the alpha value of each vertex to produce the effect in the specific places (in the windows) search this forum for an example of a reflecting/glass car windows that uses the same material for all the car (and the alpha value in the car windows)

Paulov

23-12-2006 18:41:41

well

I´ve been able to do wat I was looking for, but using 2 phases :( .

With only one pass I could only make reflecting windows,the facade dissapeared.

This should be possible to be done in just a single one, no?
-according to this link provided by Lioric it seems possible:
http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=751

Butdont know how to set the "alpha blend mode" commented in there.
Also in this example the full glass is transparent and in my example only some parts of the texture are transparent, may be this makes it the need of 2 passes.

well, I´ve uploaded the working scene:
www.ikernor.com/download/ogre-forum/ofu ... phases.zip

would be nice if someone could test it and try to make it run in a single pass :wink:


About vertex alpha: In my case this facades are build with the lower number of polys, so its not a ussefull technique in this case.

Lioric

26-12-2006 16:56:47

Why not a multitexture material (not multipass)?

In a multitexture material, you can use the texture unit's blend mode properties to set the glass texture to use the alpha you want (the alpha from the image, the alpha form the vertices, or a manual defined alpha value)

Paulov

04-01-2007 14:12:18

Yes Lioric

Multitexture has been the first I tried, but cant get what I find.



I´ve edited the texture and put the windows in gray, thinking that this gray alpha would make the windows appear softer and let the next texture unit (the env map) be visible only trought them.

But the windows appear as holes.

the new texure:
www.ikernor.com/download/ogre-forum/ofu ... stal_2.tga

bye

yuriythebest

05-01-2007 12:50:12

I have a hack solution: create the original building with transparent windows, and inside that building create a cube with a reflection map, make sure it's as close to the original building walls to seem part of em yet far enough for there not to be any overlapping. You could use that as a temporary fix untill the propper way is found.

yuriythebest

05-01-2007 13:01:51

couldn't resist trying my method myself, the results look quite convincing:

Paulov

06-01-2007 16:40:18

Hi Yuri

The final ressult is not bad, but with this method the elements on the windows like curtains etc dissapear. And the effect is not very realistic....

Also notice that in the window frames appears a "sharp" effect.

If I cant get he effect in a single pass with the texture blendings i´ll use two passes or leave this for the future, as time for my project starts to be a bit tight.

Anyway, thanks Yuri.

Paulov

22-05-2007 18:23:18

HEY!!

I didnt know that Lioric finally made an example related to this!!!

http://www.ofusiontechnologies.com/scenes.html


Thanks a lot for you help!!!

I´ll implement "reflections" to my buildings as fast as I made some tests and I master the demo scene´s material.


THANKS!!!!

Paulov

26-05-2007 19:18:03

Hey

well, I´m done.


video:
www.ikernor.com/download/ogre-forum/ofu ... eflexo.avi

I placed a couple of screens that are not showing..

screen1
www.ikernor.com/download/ogre-forum/ofu ... /test1.jpg

screen2
www.ikernor.com/download/ogre-forum/ofu ... /test2.jpg

Lioric

28-05-2007 16:18:53

Your Cityex project keeps getting better and better, excellent job :)

Paulov

10-06-2007 16:12:26

Hi

well, the effect of the reflection was cool, but looking at the images& videos of gothan project... mmm.. I saw that something more was needed.

Even if the glasess "reflect", they have the same specular level as the rest of the building, and this, oviously is not possible.

So, playing with monster shader 1.0 Ive finaly got what I was looking for.
Here is the video, the effect is super nice.

video
www.ikernor.com/download/ogre-forum/ofu ... gothan.avi


Now, what happens with the shadders.
I dont like them at all because they "override" the normal material system, it does not matter what you change in the classic specular color, blending mode etc , it wont change the materials appearance.

When I first heard about shaders, I thoug that for exampel a normal mapping shader would ADD the possibility of having bump maping in an standard material by just loading that shadder and adding the normal map texture. But the shaders dont work ADDING features , and this is no good.

For example now, I´ve this cool specular windows, but I cant add the effect of the mirror clouds because it has not programed the enviroment mapping option ...

So the Shaders Should ADD properties to stantdard materials, not limit them so much.... bla blabla... this is my artis point of view.

As I dont have a monkey that programs shaders for me, the shaders dont seduce me at all. :cry:

Evak

11-06-2007 03:41:17

I know what you mean regarding shaders. There are some good tools out there that are more artist friendly. But they don't save out in engine friendly formats.

3DS max's own shaders that it creates from the standard material library are nice and produce fairly decent representations of what you want. But they aren't really optimized for realtime game purposes, just for representation in 3dsmax.

I have tried various material editors but they all save out .FX files which need some extra work to get into Ogre, and some extra steps for Ofusion.

Shaders have only really been around for about 5 years in PC games, and a little longer on Xbox. I expect somewhere down the road things will mature, standards will be established and Artists will get the tools they need.

Afterall, all the 3dsmax material system and things like the scanline renderer, mental ray, renderman etc are really using their own shaders to produce the materials you render for video etc.

Paulov

11-06-2007 08:20:03

I have tried various material editors but they all save out .FX

--> so, this engine should work with a wider range of this toys. Including this .fx etc.

Lioric

12-06-2007 19:12:07

It does support .fx files (using the fx to ogre tools), but bear in mind that you want a very specialized feature (shaders) to become a general usage tool (fixed graphics pipeline), and to avoid this is why shaders were created

Evak

12-06-2007 20:39:56

I tried the FXogretool with FX files exporter from shaderFX as both 3dsmax FX and Microsofts DXSAS 0.8 .fx format. But couldn't get them to work.

I also tried it with some found shaders, but it seems that FXogretool only works out of the box with a handfull of shader samples I have found and tried. So I think you need to have programming and shader knowledge to make them compatible by editing in a text editor. Which is quite difficult for artists with only the most basic scripting knowledge.