着色器与着色器材质,特定于 papervision,欢迎一般见解

发布于 2024-09-02 23:13:58 字数 376 浏览 3 评论 0原文

我在 pv3d 论坛上问了这个问题,但没有人能够或愿意回答它。

我对 3d 还比较陌生,所以如果这对某些人来说是常识,我深表歉意。

我有一个球体,我正在其中应用 CellMaterial。看起来很棒。 我注意到在papervision sdk中,还有一个CellShader。

我应该将其与 CellMaterial 一致使用吗? 应该是其中之一还是另一个? Shader 是 Shader Material 的已弃用做法吗?

我最初的想法是着色器适用于整个场景,而材质可以唯一地应用于对象。

文档似乎另有说明。

同时使用 CellShader 和 CellMaterial 可以获得什么好处?我真的很喜欢以某种方式将一些环境融入其中。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏末的微笑 2024-09-09 23:13:58

如果您只是追求细胞外观,而不是其他,CellMaterial 是您的选择。
CellShader 的目的是将其与 ShadedMaterial 中的 BitmapMaterial 混合。

假设您应用了 GaraudMaterial 并且喜欢它的外观,但您还想要其中的纹理。使用 GaraudMaterial 无法做到这一点,但如果您有 BitmapMaterial 和 GaraudShader,则可以创建使用这两个材质的 ShadedMaterial。

例如,

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);

要了解更多说明,请查看 Jim Foley 的帖子

至于环境光遮挡,获得效果的最便宜的方法是烘焙阴影 进入纹理。您可以使用您选择的 3D 编辑器(3dsmax、maya、blender 等)来完成此操作,这基本上意味着灯光/阴影将渲染到纹理中。
mr.doob 纹理烘焙

这方面有一些工作 动态,但尚未检查是否已纳入 Papervision 的最新版本。

kode80 ssao

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.
mr.doob texture baking

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

kode80 ssao

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文