Hi.. I'm rather new to 3d games development.. On my latest rpg project.. i'm trying to design a 3d world that is keep changing base on the character movement.. something like the grimm..
it will be like this.. in it initial state.. the world will look dark and gloomy.. and then.. when the character moved.. part of the world that is visited by the character will lighten.. it would be great if this trantition can be animated..
for sprite like plantation.. or building.. i think i can just create an animatedmesh that goes from gloomy to light.. and play the animation when the character get close enough.. but how do we do this for the terrain/world?
on a 2d games.. i think i can achive something like this using tile set.. and just change the image rendered for each tile that has been visited.. but how can we achive this in 3d world?
can we do something like.. create a plane that has 2 material.. in initial state.. only the default material will be shown.. but when the character moved.. part of this default material will be transparent and the other material will be shown.. or maybe 2 plane.. one with the gloomy material.. and the other with the lighten material..
anyone got an idea?? thx..
- Learn Something About Everything And Everything About Something -
coz the material for the gloomy mood and the lighten mood will be different.. hmm.. for an example.. on a rocky terrain.. the gloomy mood will have a rock that crack.. but on the lighten mood.. the rock will be solid and shiny.. for a flower.. on the gloomy mood.. it will look dead and grey.. on the other hand.. it will look fresh and collorfull..
thx for the quick reply..
- Learn Something About Everything And Everything About Something -
ok, ok, i thought it was just a lighting issue rather than different textures all together.
so yeah... you could use a double layered material on the objects and alter the weight of which texture comes through most... that would probably require you to write your own shader for it, i don't know if you know how to do shaders thought...
alternatively you could double up everything so there's two of each nodes... imagine a rock.. you have the same rock twice; one with the dull material, one with the bright. The bright one is invisible to start with When you want to trigger the change you make the bright one visible but completely transparent and then fade it in and fade out the dull one. Not sure if it's actually possible to fade objects that easily though...
EMT_SOLID_2_LAYER will do the trick if you're using the D3D driver. It's not implemented on OGL though.
This example uses a general purpose method to get the nearest vertex to a line through the cursor. You should be able to find a smarter method of finding the vertex / vertices in your game world that need manipulated.