您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
27 行
901 B
27 行
901 B
struct vdata
|
|
{
|
|
float2 vertex;
|
|
float2 uv;
|
|
};
|
|
|
|
struct psInput
|
|
{
|
|
float4 position : SV_POSITION;
|
|
};
|
|
|
|
StructuredBuffer<vdata> databuffer;
|
|
StructuredBuffer<int> indexbuffer;
|
|
float4 _viewport;
|
|
int _startVertex;
|
|
|
|
psInput vert (uint vertex_id: SV_VertexID, uint instance_id: SV_InstanceID)
|
|
{
|
|
psInput o = (psInput)0;
|
|
o.position = float4(databuffer[indexbuffer[_startVertex + vertex_id]].vertex.x * 2.0 / _viewport.z - 1.0, databuffer[indexbuffer[_startVertex + vertex_id]].vertex.y * 2.0 / _viewport.w - 1.0, 0, 1);
|
|
return o;
|
|
}
|
|
|
|
fixed4 frag (psInput i) : SV_Target
|
|
{
|
|
return float4(0, 1, 0, 1);
|
|
}
|