It finally imports somewhat
This commit is contained in:
@@ -26,10 +26,10 @@ float4 fragmentMain(in FragmentParameter params) : SV_Target
|
||||
{
|
||||
result += pLightEnv.directionalLights[i].illuminate(lightingParams, brdf);
|
||||
}
|
||||
for(uint i = 0; i < pLightEnv.numPointLights; ++i)
|
||||
for(uint i = 0; i < lightCount; ++i)
|
||||
{
|
||||
//uint lightIndex = pLightCullingData.lightIndexList[startOffset + i];
|
||||
result += pLightEnv.pointLights[i].illuminate(lightingParams, brdf);
|
||||
uint lightIndex = pLightCullingData.lightIndexList[startOffset + i];
|
||||
result += pLightEnv.pointLights[lightIndex].illuminate(lightingParams, brdf);
|
||||
}
|
||||
return float4(result, 1.0f);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ struct BlinnPhong : IBRDF
|
||||
float3 baseColor;
|
||||
float metallic;
|
||||
float3 normal;
|
||||
float3 specular;
|
||||
float roughness;
|
||||
float sheen;
|
||||
|
||||
@@ -18,7 +17,6 @@ struct BlinnPhong : IBRDF
|
||||
{
|
||||
metallic = 0;
|
||||
normal = float3(0, 0, 1);
|
||||
specular = 0.5;
|
||||
roughness = 0.5;
|
||||
sheen = 1;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import Common;
|
||||
|
||||
#define MAX_NUM_TEXCOORDS 8
|
||||
|
||||
struct MaterialParameter
|
||||
{
|
||||
float3 position_WS;
|
||||
float2 texCoords[MAX_NUM_TEXCOORDS];
|
||||
float2 texCoords[1];
|
||||
float3 vertexColor;
|
||||
};
|
||||
|
||||
@@ -27,16 +25,13 @@ struct FragmentParameter
|
||||
float3 biTangent_WS : TANGENT1;
|
||||
float3 position_WS : POSITION2;
|
||||
float3 vertexColor : COLOR0;
|
||||
float2 texCoords[MAX_NUM_TEXCOORDS] : TEXCOORD0;
|
||||
float2 texCoords : TEXCOORD0;
|
||||
MaterialParameter getMaterialParameter()
|
||||
{
|
||||
MaterialParameter result;
|
||||
result.position_WS = position_WS;
|
||||
result.vertexColor = vertexColor;
|
||||
for(int i = 0; i < MAX_NUM_TEXCOORDS; ++i)
|
||||
{
|
||||
result.texCoords[i] = texCoords[i];
|
||||
}
|
||||
result.texCoords[0] = texCoords;
|
||||
return result;
|
||||
}
|
||||
LightingParameter getLightingParameter()
|
||||
@@ -57,7 +52,7 @@ struct VertexAttributes
|
||||
float3 tangent_MS;
|
||||
float3 biTangent_MS;
|
||||
float3 vertexColor;
|
||||
float2 texCoords[MAX_NUM_TEXCOORDS];
|
||||
float2 texCoords;
|
||||
FragmentParameter getParameter(float4x4 transformMatrix)
|
||||
{
|
||||
float4 modelPos = float4(position_MS, 1);
|
||||
@@ -75,10 +70,7 @@ struct VertexAttributes
|
||||
result.position_WS = worldPos.xyz;
|
||||
result.position_CS = clipPos;
|
||||
result.vertexColor = vertexColor;
|
||||
for(int i = 0; i < MAX_NUM_TEXCOORDS; ++i)
|
||||
{
|
||||
result.texCoords[i] = texCoords[i];
|
||||
}
|
||||
result.texCoords = texCoords;
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,7 +11,7 @@ struct StaticMeshVertexData : IVertexData
|
||||
attributes.normal_MS = float3(normals[3 * index + 0], normals[3 * index + 1], normals[3 * index + 2]);
|
||||
attributes.tangent_MS = float3(tangents[3 * index + 0], tangents[3 * index + 1], tangents[3 * index + 2]);
|
||||
attributes.biTangent_MS = float3(biTangents[3 * index + 0], biTangents[3 * index + 1], biTangents[3 * index + 2]);
|
||||
attributes.texCoords[0] = float2(texCoords[2 * index + 0], texCoords[2 * index + 1]);
|
||||
attributes.texCoords = float2(texCoords[2 * index + 0], texCoords[2 * index + 1]);
|
||||
attributes.vertexColor = float3(color[3 * index + 0], color[3 * index + 1], color[3 * index + 2]);
|
||||
return attributes;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user