I asked this question on the pv3d forum and开发者_运维技巧 not a single person could, or cared to answer it.
Im relatively new to 3d so i apologize if this is common sense to some.
I have a sphere , in which i am applying a CellMaterial to. Looks great. I noticed that in the papervision sdk , there is also a CellShader.
Should I be using this in congruence with the CellMaterial ? Should it be one or the other ? Is shader , a deprecated practice to Shader Material ?
My initial thoughts were that the shader applies to the whole scene , while materials can be applied uniquely to objects.
The documentation seems to show otherwise.
What benefit if any could be gained by using both a CellShader and a CellMaterial ? id really love to get some ambient inclusion in there some how.
If you're just after the cell look, and nothing else, CellMaterial is your choice. The purpose of the CellShader is to mix it with a BitmapMaterial in a ShadedMaterial.
Say you apply a GaraudMaterial and like the look, but you also want a texture in there. Can't do that with a GaraudMaterial, but if you have a BitmapMaterial and a GaraudShader, you can create a ShadedMaterial that uses the two.
e.g.
var bitmapMaterial:BitmapMaterial = new BitmapMaterial(yourBitmapData);
var shader:PhongShader = new PhongShader(yourLight,0xFFFFFF, 0x000000,0,yourBumpMap);
//this uses the two above
var shadedMaterial:ShadedMaterial = new ShadedMaterial(bitmapMaterial,shader);
//apply it to something
var sphere:Sphere = new Sphere(shadedMaterial,250,10,10);
For more explanations checkout Jim Foley's post.
As for Ambient Occlusion, the cheapest way you can get the effect is to bake the shadows into the texture. You do that with the 3D editor of your choice(3dsmax,maya,blender,etc.), and it basically means the light/shadows are rendered into the texture.
There is some work on doing this dynamically, haven't checked if that made into the latest version of Papervision though.
精彩评论