fade texture to material/vertex color?

Ive noticed some old games seem to fade from a texture to a material or vertex color for distant objects. Is there a way to just set this by a function? Or is the effect not what I think it is?

Ive also read somewhere in the API docs about being able to set per-pixel lightning change to per-vertex for distant object automatically or something, or maybe for geomipterrain. I cant remember where it was mentioned, so I understand if you cant help given this much info.

This what LODNode or FadeLODNode does for you. You need two copies of the model, one with texture, and a simpler one with only material or vertex color.


How about enabling/disabling texture with a task? I think its not worth it to have 2 copies of every object in memory (unless is cached, but then its not very straight forward for modellers having to export the model 2 times, one with texture, one without).

Usually these untextured models also have far fewer vertices, which makes having two copies worthwhile.

If your modelers aren’t used to constructing multiple LOD’s, then you might consider finding more experienced modelers. :wink: Multiple versions of every model is a common practice in the industry. But you can accomodate your inexperienced modelers by loading the model twice, and removing texture in one of them in code. Of course, then you don’t get the benefit of fewer vertices.

But, yeah, you can also remove the texture in a task if you like. That’s the hard way to do it.


That would be me :laughing:
I dont mean that, I mean it wouldnt make much sense to a modeller to delete an assigned texture and export the same model just for that. But hey, unassigning a texture by code on the dublicate node is an idea.

Im totally quessing here, but Ive noticed something like that (texture fade to color) which seemed to be happening on a one whole geom. Is that possible? It was like fog, but not with a single color.

That actually brings another question: does fog help performance by not rendering the textures hidden under fog, even if the node isnt clipped by camera?

I’m almost certain that’s an LOD fade between two different models.


Im not sure.
I couldnt find a better quality. Im talking about the walls. The distant ones have a single color, the texture appears when you get close. Not sure if you can notice it in the video…
The “fading” seems to happen on “per-face” basis.

That game was developed on the original PlayStation, which had different performance characteristics than a PC. In particular, texturing was expensive, but large numbers of individual Geoms were not. So for that platform it made sense to make each face of the wall be a separate Geom that could be individually LOD’ed to remove textures.

On a PC, that doesn’t make sense at all. Texturing is cheap and Geoms are expensive.


kinda ironic.

Anyway, what about fog? Does fog help when you don’t want to render distant parts of the textured geometry? Even if it isnt clipped?
And is there a limit for the number of fogs, like lights then?

Fog doesn’t help by itself. For optimization purposes, fog is only useful as a tool to hide the clipping plane.

You can only have one fog per object. You can have any number of fogs you like in the scene overall, but each object in the scene may only have one fog applied.


Well I guess fog is useless then for my purpose.

But out of curiosity, is there a standard limit of fogs at which the framerate starts to drop?

I don’t know what you mean. Fog is just an additional per-pixel step performed by the GPU after it has computed the pixel color. It costs a little bit, but not much, so in practice it generally has zero effect on frame rate.

As I said, when you use fog as an optimization tool, you’re just using it to hide the fact that you brought the clipping plane in really close. There’s no standard distance for bringing the clipping plane; nor is there a standard value for fog density or any of these things. Optimization questions always depend heavily on the precise nature of your scene, and the precise hardware you are targeting.


I meant if they had some standard amount limit, like 4/8 for lights. Guess not.