本文整理汇总了C++中vs_output::position方法的典型用法代码示例。如果您正苦于以下问题:C++ vs_output::position方法的具体用法?C++ vs_output::position怎么用?C++ vs_output::position使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs_output
的用法示例。
在下文中一共展示了vs_output::position方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: shader_prog
void shader_prog(const vs_input& in, vs_output& out)
{
vec4 pos = in.attribute(0);
vec4 nor = in.attribute(1);
out.position() = out.attribute(0) = vec4(0.0f, 0.0f, 0.0f, 0.0f);
pos.w(1.0f);
nor.w(0.0f);
for(int i = 0; i < 4; ++i)
{
union {float f; int i;} f2i;
f2i.f = in.attribute(3)[i];
float w = in.attribute(4)[i];
int boneIndex = f2i.i;
if(boneIndex == -1){break;}
vec4 skin_pos;
vec4 skin_nor;
transform(skin_pos, invMatrices[boneIndex], pos);
transform(skin_pos, boneMatrices[boneIndex], skin_pos);
transform(skin_nor, invMatrices[boneIndex], nor);
transform(skin_nor, boneMatrices[boneIndex], skin_nor);
out.position() += (skin_pos*w);
out.attribute(0) += (skin_nor*w);
}
transform(out.position(), out.position(), wvp);
// out.attribute(0) = in.attribute(1);
out.attribute(1) = in.attribute(2);
out.attribute(2) = light_pos - pos;
out.attribute(3) = eye_pos - pos;
}
示例2: shader_prog
void shader_prog(const vs_input& in, vs_output& out)
{
vec4 pos = in.attribute(0);
transform(out.position(), pos, wvp);
out.attribute(0) = in.attribute(0);//(vec4(1.0f, 1.0f, 1.0f, 1.0f) - in[0]);
out.attribute(1) = in.attribute(1);
}
示例3: shader_prog
void shader_prog(const vs_input& in, vs_output& out)
{
vec4 pos = in.attribute(0);
transform(out.position(), pos, wvp);
out.attribute(0) = in.attribute(1);
out.attribute(1) = in.attribute(2);
out.attribute(2) = light_pos - pos;
out.attribute(3) = eye_pos - pos;
}
示例4: shader_prog
void shader_prog(const vs_input& in, vs_output& out)
{
vec4 pos = in.attribute(0);
vec4 pos_es, normal_es;
transform(pos_es, pos, wv);
transform33(normal_es, in.attribute(1), wv);
transform(out.position(), pos_es, proj);
out.attribute(0) = vec4(light_pos - pos_es.xyz(), 1);
out.attribute(1) = vec4(eye_pos - pos_es.xyz(), 1);
out.attribute(2) = normal_es;
}