INTERESTING

Posted By: Raymaker

INTERESTING - 04/27/07 11:47

I have an idea of a shader that makes shadows on everything that has it attached.It works on the vertex level so I thought that making a c_trace in the material event function that looks like this (this is for explenation)
a= world transformed pos of vertex;
b = sun position
c_trace(a,b,....);

And if value of a could somehow be sent from material to the material's event it should work this way;
If you have some other ides post them here
c_trace(a,b,....);

if(you== sun_entity){//sun entity is the model placed enywhere
c=1; // c=number between 0 and 1;

}else {

c=0;
}than the c value should be sent back to the shader(I dont know how)

and the color "mul"-ed with c;

this should darken the vertexes that are not seen by the sun_entity;

this i think is a faster metod of making shadows on the surfaces tht don't need a detiled shadows; I ask you to help me get it right and working;I'll be very thakfull;
Posted By: broozar

Re: INTERESTING - 04/27/07 11:57

that's how the terrain shadow baker from AU works. but you won't believe how slow a complete c_trace for a 512*512 array is (262144 traces per image and object-> 30 fps minimum->almost 8 million traces/s (with only one object to be shadowed, like terrain) with a function that's marked as "slow"). so it's only usable for baking.
© 2024 lite-C Forums