2 Unrelated, Pretty General Questions

Question 1:

How have people created, visually, a sun that rises and sets? I have the light with the flare attached, but there are two issues I’m encountering. 1) There is no sun…just the flare. 2) when the sun crosses parts of the skybox that are clouds, it’s still visible (I know the skybox is drawn first, so will be “behind” everything).

How have people created suns with actual discs? Is it a 2D billboarded texture? My experience with the flare effects is that anything between it and the camera will cause it to fade out. Do you (can you) place a 2D billboard behind the flare?

Is there anyway to get the sun object to react to the skybox clouds? My first thought is to read the pixels from the skybox behind the sun, and when the sun is passing over pixels that are in the range of white to gray (not sure exactly how I would implement that), have the sun fade out (like a flare would if it were an actual object). I don’t even know how feasible that would be. Have there been any solutions to this one?

Question 2 (more like question 4):

What is the “standard” practice for fallbacks for bumpmap effects on cards that don’t support pixel shaders? Should I just create a flat diffuse texture that gets used instead when the card can’t do bumpmapping?

  1. You can download the sources to all default shaders, that should give you an idea.
    Generally: as normal maps are just 1 texture in the shader (the diffuse texture is always present too, together with others), you just ignore those textures that are not supported.
    If a card is pre-shader, then the only thing remaining for you is actually to just cut anything but the diffuse texture as you can’t use any cg programs any longer

Yeah, but with what I am doing, the normalmap is critical. The diffuse texture is just used to blend the bumpmapping in with the terrain. So, without the normal map, you’d be looking at a plane that matches the terrain (essentially, you wouldn’t see anything). So, it sounds like, from what you are saying, I would have to just draw on a diffuse texture what the normalmap was simulating.

Picture a crater. I can create a normalmap of a crater that would work with pixel shaders, and then I’d have to actually draw a crater and use that when the cards don’t support the shaders.