游戏开发论坛

 找回密码
 立即注册
搜索
查看: 3330|回复: 14

请教Effect的问题

[复制链接]

132

主题

1341

帖子

1341

积分

金牌会员

Rank: 6Rank: 6

积分
1341
发表于 2005-4-10 14:37:00 | 显示全部楼层 |阅读模式
我初学Effect,这是一个FX文件,pass0和pass1都做出来了,就是pass 2没反应,这是什么问题,与显卡有关吗?
texture texture0;
texture texture1;
texture texture2;

technique TwoPassTextureBlend
{
    pass Pass0
    {
               
        AlphaBlendEnable = False;

        Texture[0] = <texture0>;

        ColorOp[0]   = SelectArg1;
        ColorArg1[0] = Texture;

        ColorOp[1]   = Disable;
    }

    pass Pass1
    {
               
        AlphaBlendEnable = True;
        SrcBlend  = One;
        DestBlend = One;

        Texture[0] = <texture1>;

        ColorOp[0]   = SelectArg1;
        ColorArg1[0] = Texture;

        ColorOp[1]   = Disable;
    }
    pass Pass2
    {
       
        AlphaBlendEnable = True;
        SrcBlend  = One;
        DestBlend = One;

        Texture[1] = <texture2>;

        ColorOp[1]   = Modulate;
        ColorArg1[1] = Texture;
        ColorArg2[1] = Current;

        ColorOp[2]   = Disable;
    }
}

18

主题

573

帖子

573

积分

高级会员

Rank: 4

积分
573
发表于 2005-4-10 21:17:00 | 显示全部楼层

Re:请教Effect的问题

看看你的
ColorArg2[1] = Current;
ColorOp[2]   = Disable;
这些索引,为什么有时是1,有时是2;我觉得Pass2的索引应该是2吧!你的Pass1也有同样的问题。

132

主题

1341

帖子

1341

积分

金牌会员

Rank: 6Rank: 6

积分
1341
 楼主| 发表于 2005-4-11 12:34:00 | 显示全部楼层

Re:请教Effect的问题

Pass2的索引是1已经很怪,而如果是2更怪,好像很多人都时说应该是0!

69

主题

450

帖子

473

积分

中级会员

战魂缔造者

Rank: 3Rank: 3

积分
473
QQ
发表于 2005-4-11 14:57:00 | 显示全部楼层

Re:请教Effect的问题

pass是渲染多少遍的索引号,而ColorOp,AlphaOp的那个数组下标表示的是纹理混合的层索引号,2个不是同一个东西

2

主题

29

帖子

29

积分

注册会员

Rank: 2

积分
29
发表于 2005-4-11 18:23:00 | 显示全部楼层

Re: Re:请教Effect的问题

sunicdavy: Re:请教Effect的问题

pass是渲染多少遍的索引号,而ColorOp,AlphaOp的那个数组下标表示的是纹理混合的层索引号,2个不是同一个东西


那是不是?每一个pass不能有继承的关系, 比如在pass1里的纹理混合
不能在pass2中继续连起来, 每一个pass是不是都应为个体.
每一个pass都应从第一层纹理开始混合. 例如:
    pass Pass2
    {

        AlphaBlendEnable = True;
        SrcBlend  = One;
        DestBlend = One;

        Texture[0] = <texture0>;
        Texture[1] = <texture1>;


        ColorOp[0]   = Modulate;
        ColorArg1[0] = Texture;
        ColorArg2[0] = Current;

        ColorOp[2]   = Disable;
    }
     

132

主题

1341

帖子

1341

积分

金牌会员

Rank: 6Rank: 6

积分
1341
 楼主| 发表于 2005-4-11 18:31:00 | 显示全部楼层

Re:请教Effect的问题

其实为是想做出两次乘法纹理混合,他家有没有方法教教我?!

2

主题

29

帖子

29

积分

注册会员

Rank: 2

积分
29
发表于 2005-4-11 18:34:00 | 显示全部楼层

Re: Re: Re:请教Effect的问题

260013004: Re: Re:请教Effect的问题



那是不是?每一个pass不能有继承的关系, 比如在pass1里的纹理混合
不能在pass2中继续连起来, 每一个pa...


[em7] [em7] [em7]   [em4] [em4] [em4]!!!!!!

不好意思按错键, 按到了enter了, 发太快了,
如果小弟有错请大家原谅!!
请各位高手来指点一下!!!

那是不是?每一个pass不能有继承的关系, 比如在pass1里的纹理混合
不能在pass2中继续连起来, 每一个pass是不是都应为个体.
每一个pass都应从第一层纹理开始混合. 例如:
    pass Pass2
    {

        AlphaBlendEnable = True;
        SrcBlend  = One;
        DestBlend = One;

        Texture[0] = <texture0>;
        Texture[1] = <texture1>;

        ColorOp[0]   = SelectArg1;
        ColorArg1[0] = Texture[0];

        ColorOp[1]   = Modulate;
        ColorArg1[1] = Texture[1];
        ColorArg2[1] = Current;
    }

2

主题

29

帖子

29

积分

注册会员

Rank: 2

积分
29
发表于 2005-4-11 18:37:00 | 显示全部楼层

Re:请教Effect的问题

  这样你看行不行
  pass Pass1
    {

        AlphaBlendEnable = True;
        SrcBlend  = One;
        DestBlend = One;

        Texture[0] = <texture0>;
        Texture[1] = <texture1>;
        Texture[2] = <texture2>;

        ColorOp[0]   = SelectArg1;
        ColorArg1[0] = Texture[0];

        ColorOp[1]   = Modulate;
        ColorArg1[1] = Texture[1];
        ColorArg2[1] = Current;

        ColorOp[2]   = Modulate;
        ColorArg1[2] = Texture[2];
        ColorArg2[2] = Current;
    }

132

主题

1341

帖子

1341

积分

金牌会员

Rank: 6Rank: 6

积分
1341
 楼主| 发表于 2005-4-11 18:45:00 | 显示全部楼层

Re:请教Effect的问题

显卡不行,我是想用multipass最大限度模拟乘法

2

主题

29

帖子

29

积分

注册会员

Rank: 2

积分
29
发表于 2005-4-11 18:51:00 | 显示全部楼层

Re:请教Effect的问题

我才TNT(98年的)的显卡不也一样编程, 用模拟层编程知道效果就行了
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-12-25 06:23

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表