2017-08-29 02:29:06 +00:00
|
|
|
struct a2v
|
|
|
|
{
|
|
|
|
float4 pos: POSITION;
|
|
|
|
};
|
|
|
|
struct v2f
|
|
|
|
{
|
|
|
|
#ifndef FRAGMENT_SHADER
|
|
|
|
float4 pos: POSITION;
|
|
|
|
#endif
|
|
|
|
float3 texc: TEXCOORD0;
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef VERTEX_SHADER
|
|
|
|
float4x4 m_modelviewprojection;
|
|
|
|
v2f main (a2v inp)
|
|
|
|
{
|
|
|
|
v2f outp;
|
|
|
|
outp.pos = mul(m_modelviewprojection, inp.pos);
|
2017-11-23 07:46:39 +00:00
|
|
|
outp.texc = inp.pos.xyz;
|
2017-08-29 02:29:06 +00:00
|
|
|
return outp;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef FRAGMENT_SHADER
|
2017-11-23 07:46:39 +00:00
|
|
|
float3 e_eyepos;
|
2017-08-29 02:29:06 +00:00
|
|
|
sampler s_reflectcube;
|
|
|
|
float4 main (v2f inp) : COLOR0
|
|
|
|
{
|
2017-11-23 07:46:39 +00:00
|
|
|
float3 tc = inp.texc - e_eyepos.xyz;
|
|
|
|
tc.y = -tc.y;
|
|
|
|
return texCUBE(s_reflectcube, tc);
|
2017-08-29 02:29:06 +00:00
|
|
|
}
|
|
|
|
#endif
|