开发者

Shader vs Shader Material , papervision specific , general insight welcome

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.

Shader vs Shader Material , papervision specific , general insight welcome

There is some work on doing this dynamically, haven't checked if that made into the latest version of Papervision though.

Shader vs Shader Material , papervision specific , general insight welcome

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜