小编Ton*_*ony的帖子

HLSL:清空fx文件:X3000:意外标记'{'

出现以下错误:Test.fx(1,1):错误X3000:语法错误:意外标记'{'

Text.fx包含:没什么.

我也尝试了一个效果文件,在另一个测试项目中工作正常:

float4x4 mWorld;

struct TInputVertex {
    float3 vPosition    : POSITION0;
    float3 vNormal      : NORMAL0;
    float2 vTexCoord    : TEXCOORD0;
    float4 vColor       : COLOR0;
};

struct TOutputVertex {
    float4 vPosition    : POSITION0;
    float3 vNormal      : TEXCOORD1;
    float4 vColor       : COLOR0;
};

TOutputVertex vsMain(TInputVertex i) {
    TOutputVertex o;

    o.vPosition = mul(float4(i.vPosition, 1), mWorld);
    o.vColor = i.vColor;

    o.vNormal = mul(float4(i.vNormal, 1), mWorld).xyz;

    //o.vColor += pow(dot(normal_world, float3(0, 0, 1)) * 2 + 0.3, 10);

    return o;
}

struct TInputFragment {
    float3 vNormal      : …
Run Code Online (Sandbox Code Playgroud)

directx hlsl

6
推荐指数
1
解决办法
5244
查看次数

DirectX HLSL包含指令不起作用

该文件:http: //msdn.microsoft.com/en-us/library/dd607349(v = vs.85).aspx

声明#include"foobar.fx"将在与当前效果文件相同的目录中查找该文件.

它不起作用,但使用绝对路径确实没有用,这当然是无用的.

谷歌没有提出任何建议.我在这里缺少什么?

c++ directx directive hlsl include

3
推荐指数
2
解决办法
3615
查看次数

std :: map自定义键非唯一性问题

无法在Google上找到答案..

当我使用std :: string时,以下工作正常.

map <fxString, int> test;
test.insert(pair <fxString, int> ("Bla", 1));
test.insert(pair <fxString, int> ("Bla", 2));
test.insert(pair <fxString, int> ("Bla", 3));
cout << fxInt2String(test["Bla"]) << endl;
Run Code Online (Sandbox Code Playgroud)

哪个应该输出1,而是输出0

当我遍历地图时,每个键值对都在那里,坐在彼此旁边嘲笑我.

fxString定义以下运算符:operator> operator <operator == operator!=

还有更多,我测试了它们..

格罗姆.

c++ stl key map

0
推荐指数
1
解决办法
803
查看次数

标签 统计

c++ ×2

directx ×2

hlsl ×2

directive ×1

include ×1

key ×1

map ×1

stl ×1