Hi there!
I thinking on adding a feature to my engine and I wanted to know if you guys considered a better approach than mine:
I want to render my plants on shadows dimmer than the others on light. This idea surged from a conversation with Zeeoverlod analyzing the FarCry Engine in this post :
FarCryâs screenshot .
(The point is that both trees are the same and are lighted different according to the shadowmap projected on the groud, and that they are completely shaded or unshaded)
I just implemented a heightmap where my plants lay, and the terrain has:
- 2048x2048 base texture that contains shadows (I am in the process of implenting shadowmaps, but I am going to be using them only for projecting the plantâs shadows on the terrain, so I will not be using the shadowmapâs values in the next approach)
- Detail texture
I was considering this idea:
For each plant position, get a group of sample associated pixels (just below the plant) from the terrain base texture, and calculate an average lumen value with the R, G, and B components of the associated pixels.
If lumenValue is less than X then the plant is more in the shadow than in the light: set material properties of plant to low ambient and diffuse, else set to high ambient and diffuse (I always use no specular as the plants are very low poly). Equivalently another method could be: multiply plantâs material property by average lumen value too.
1-Do you consider this a good idea? Any better approach? (assuming no GLSL support)
2- Taking this to the next level: using GLSL, I saw that most engines apply a âBloomâ shader to the plants. Also per pixel lighting?
Thanks so much in advance,
Rod
P.S: When I try per-pixel lighting in my FX5500 (even a simple phong shader with texture) or anything Shader-related my FPS instantly drops to 10-12fps (from 80-90fps). I know now that my card is not prepared for shaders, however I was wondering if I buy a GeForce 6 or 7 if my fps will boost significantly or not?