texCUBE() to CubemapSampler.Sample()

 

update dx9 to dx11

refers to   CUBEMAP sampler

texCUBE(CubeMpaSampler,normal)

 

maybe change to 

CubemapSampler.Sample(CubeMapSamplerState,???)

 

??? 这里需要一个 三维向量 

我写normal.xyz

but the sample result seems a pyramid

 

http://msdn.microsoft.com/en-us/library/windows/desktop/ff476122%28v=vs.85%29.aspx

technique syntax

 

struct SKYMAP_VS_OUTPUT	//output structure for skymap vertex shader
{
	float4 Pos : SV_POSITION;
	float3 texCoord : TEXCOORD;
};

Here is our skymaps VS. As you can see, we are taking in normal values for each vertex still, this is because we are going to be using the same input layout for all our geometry (so we don't have to do more code). However, we will not be using the normals. And in fact, we did not define texture coordinates for our vertices either. This is because the texture coordinates will be defined by our vertices position. We can use our vertices position as a vector, describing the texel in our texturecube to color the pixel with. You can see how we do that with the line output.texCoord = inPos;. Also, notice when we are defining the output position, we take the values .xyww instead of .xyzw. This is because w is equal to 1.0f. We want to make sure our skymap is always the furthest object in our scene, so we want to set our z value to 1.0f too, which is what w is. Remember, 1.0f is the furthest value from the screen.

 

http://www.braynzarsoft.net/index.php?p=D3D11CUBEMAP

 

 

eyepositon 的semantic问题引起

 

 

转载于:https://www.cnblogs.com/minggoddess/p/3799704.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值