游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1685|回复: 3

fx是什?格式的?n案,哪?有fx?n案的?料

[复制链接]

414

主题

611

帖子

621

积分

高级会员

Rank: 4

积分
621
发表于 2005-12-10 00:05:00 | 显示全部楼层 |阅读模式
fx是什?格式的?n案,哪?有fx?n案的?料?

#include <sas\sas.fxh>

int GlobalParameter : SasGlobal                                                            
<
    int3 SasVersion = {1, 0, 0};
   
    string SasEffectDescription = "HLSL Hands-On Workshop: Solid color";
    string SasEffectCompany = "Microsoft Corporation";
>;


float4x4 World <string SasBindAddress = "Sas.Skeleton.MeshToJointToWorld[0]";>;         
float4x4 View <string SasBindAddress = "Sas.Camera.WorldToView";>;
float4x4 Projection <string SasBindAddress = "Sas.Camera.Projection";>;


struct VSInput
{
    float4 Position : POSITION;
};

struct VSOutput
{
    float4 TransformedPosition : POSITION;
};


VSOutput VS( VSInput input )
{
    VSOutput output;
   
    // Transform to clip space by multiplying by the basic transform matrices.
    output.TransformedPosition = mul(input.Position, mul(World, mul(View, Projection)));
   
    return output;   
}


float4 PS( VSOutput input ) : COLOR
{

    float3 color = {0.2, 0.4, 0.8};
    //float3 color = ?
   
    // Set alpha to 1.0 and return
    return float4(color, 1.0);
}

technique Earth
{
    pass P0
    {   
        VertexShader = compile vs_2_0 VS();
        PixelShader  = compile ps_2_0 PS();
    }
}

13

主题

90

帖子

96

积分

注册会员

Rank: 2

积分
96
发表于 2005-12-10 11:13:00 | 显示全部楼层

Re:fx是什?格式的?n案,哪?有fx?n案的?料

是NVIDIA的Cg shader的内容吧,叫Cgfx,可以看看NVIDIA Cg网站

132

主题

1341

帖子

1341

积分

金牌会员

Rank: 6Rank: 6

积分
1341
发表于 2005-12-10 12:45:00 | 显示全部楼层

Re:fx是什?格式的?n案,哪?有fx?n案的?料

楼上错了点......那是Direct3D专用的渲染状态文件,叫做Effect File,后缀fx,而nvidia的Cg,是包含d3d和ogl的shader的文件格式,是专门给cg使用的,语法与fx大同小异。关于fx,在dx的帮助文件里找"effect"应该可以找到

13

主题

90

帖子

96

积分

注册会员

Rank: 2

积分
96
发表于 2005-12-10 20:05:00 | 显示全部楼层

Re: fx是什?格式的?n案,哪?有fx?n案的?料

多谢楼上的更正 [em19]
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2026-1-22 21:42

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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