can this effect be done in blitz3d?

Blitz3D Forums/Blitz3D Programming/can this effect be done in blitz3d?

skyfire1(Posted 2005) [#1]
i was playing a fps (i can't remember the name) and i noticed on the lightmapped meshes that the darker parts had less detailed textures and the brighter parts had more detailed textures. can this type of lightmapping effect be done in blitz3d? any help appreciated.


sswift(Posted 2005) [#2]
If the lighting is static, then you might accomplish something like that by texturemapping your level carefully, but it doesn't seem worthwhile to do.


skyfire1(Posted 2005) [#3]
i'm saying, can this effect be done by using a function of some sort?


sswift(Posted 2005) [#4]
If I understand you right, you're asking if there is a simple way to do that effect in Blitz. The answer to that is no.

There may be some really complicated ways of getting an effect like that, but they'd also probably be much too slow to use. What I suggested was a complicated way to do it if all your lights are static that would be fast.

But I don't see any use for this sort of effect unless it actually speeds the game up. Unless you want it as some sort of special effect that looks cool, but I don't see a low res texture in dark areas looking very cool. I could see other types of texture effect in dark areas working out in interesting ways though.

If I really wanted to do an effect like this and it had to work with realtime lights, I think the only way you could do it in Blitz would be by lighting the level without textures and using the lit level for alpha and then using that somehow to blend two copies of the level together, one with high res textures and one with low res textures. If you could do that it would require some creative setting of different texture blending modes, as well as setting up the camera or even all the objects in the game in a special way, like using the alpha flag, or clearing the color buffer on the camera but not the zbuffer.

What I'm saying is even if you could accomplish this effect in Blitz, it would be very hard to set up. Not a simple function call or two. And there would be no speed benefit, and probably a major speed hit. And visually, I don't think it would be interesting enough of an effect anyway to go to all that trouble, but I guess that'd be your call.


Zmatrix(Posted 2005) [#5]
Maybe if we understood the exact Effect you are talking about.
That could be any number of effects.

Zmatrix


Mustang(Posted 2005) [#6]
You might just decribe here that LIGHTMAPS were lower resolution in the dark area; which is the usual case. Model texture resolution is the same no matter if the model is in light or shadow - but usually lightmaps cover bigget area and are thus lower in resolution... blocky lightmap on top of the detailed mesh texture may seem like that the mesh texture is lower rezz too (which it isn't).


skyfire1(Posted 2005) [#7]
i don't know how this would cause a speed hit - lightmaps are not real-time lights.


sswift(Posted 2005) [#8]
skfire:
Actually, you can have dynamic lightmaps, and that is how the original Quake did dynamic lights.

I think Unreal also did this, while modern games use pixel shaders.

Then again, with vertex shaders I guess it's possible they still use dynamic lightmaps.

You can't do either of those in Blitz through.

Okay, well if you want the effect to be on static lightmaps that makes things easier, because you can precaclulate the effect.

But is there a function to do it? No. Could you make a function to do it? Yes. Would it be easy to do so? No.

What you would need to do is:

Precalculate an inverted version of your lightmaps. Ie, Black = White.

Copy all the surfaces in your mesh so you have two of every surface and every polygon at the same location.

Texture the first set of surfaces with the low res texture the normal lightmap, and the inverted lightmap.

Texture the second set of surfaces with the high res texture, the normal lightmap, and the normal lightmap again.

You could set the first lightmap in each of these stages to x2 multiply blend if you want that effect. The second lightmap in each stage acts as an alpha map.

Finally, set the blending mode of the second set of surfaces to add blend.


What's going on here? The inverted light (alpha) map blots out any of the first surface that you want hidden. Namely, anything in the light areas. The normal light (alpha) map blots out anything in the second surface which is in dark areas. You then add the two together and the result is seeing the bits you want to see in each area.

Fairly complicated to set up, but possible.


skyfire1(Posted 2005) [#9]
wow, i think i get what you're talking about. now the only problem is that i don't know how lightmaps work very well.


sswift(Posted 2005) [#10]
Incidentally, this is exactly the same technique one might use on a terrain to get one texture to blend smoothly into another.