mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
typofix for bbMinArray, cubemap array lookups for irradiance and spec
This commit is contained in:
parent
2abdef7459
commit
1607f58bc4
2 changed files with 4 additions and 6 deletions
|
|
@ -721,7 +721,7 @@ void RenderProbeMgr::render( SceneRenderState *state )
|
||||||
|
|
||||||
MaterialParameterHandle *probePositionSC = reflProbeMat->matInstance->getMaterialParameterHandle("$inProbePosArray");
|
MaterialParameterHandle *probePositionSC = reflProbeMat->matInstance->getMaterialParameterHandle("$inProbePosArray");
|
||||||
MaterialParameterHandle *probeWorldToObjSC = reflProbeMat->matInstance->getMaterialParameterHandle("$worldToObjArray");
|
MaterialParameterHandle *probeWorldToObjSC = reflProbeMat->matInstance->getMaterialParameterHandle("$worldToObjArray");
|
||||||
MaterialParameterHandle *probeBBMinSC = reflProbeMat->matInstance->getMaterialParameterHandle("$bbMinArrayy");
|
MaterialParameterHandle *probeBBMinSC = reflProbeMat->matInstance->getMaterialParameterHandle("$bbMinArray");
|
||||||
MaterialParameterHandle *probeBBMaxSC = reflProbeMat->matInstance->getMaterialParameterHandle("$bbMaxArray");
|
MaterialParameterHandle *probeBBMaxSC = reflProbeMat->matInstance->getMaterialParameterHandle("$bbMaxArray");
|
||||||
MaterialParameterHandle *probeUseSphereModeSC = reflProbeMat->matInstance->getMaterialParameterHandle("$useSphereMode");
|
MaterialParameterHandle *probeUseSphereModeSC = reflProbeMat->matInstance->getMaterialParameterHandle("$useSphereMode");
|
||||||
MaterialParameterHandle *probeRadiusSC = reflProbeMat->matInstance->getMaterialParameterHandle("$radius");
|
MaterialParameterHandle *probeRadiusSC = reflProbeMat->matInstance->getMaterialParameterHandle("$radius");
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,7 @@ float3 iblBoxDiffuse( Surface surface, int id)
|
||||||
{
|
{
|
||||||
float3 cubeN = boxProject(surface.P, surface.N, inProbePosArray[id], bbMinArray[id], bbMaxArray[id]);
|
float3 cubeN = boxProject(surface.P, surface.N, inProbePosArray[id], bbMinArray[id], bbMaxArray[id]);
|
||||||
cubeN.z *=-1;
|
cubeN.z *=-1;
|
||||||
//return TORQUE_TEXCUBEARRAYLOD(irradianceCubemap,cubeN,id,0).xyz;
|
return TORQUE_TEXCUBEARRAYLOD(irradianceCubemap,cubeN,id,0).xyz;
|
||||||
return float3(1,1,1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float3 iblBoxSpecular(Surface surface, float3 surfToEye, TORQUE_SAMPLER2D(brdfTexture), int id)
|
float3 iblBoxSpecular(Surface surface, float3 surfToEye, TORQUE_SAMPLER2D(brdfTexture), int id)
|
||||||
|
|
@ -82,8 +81,7 @@ float3 iblBoxSpecular(Surface surface, float3 surfToEye, TORQUE_SAMPLER2D(brdfTe
|
||||||
float3 cubeR = normalize(r);
|
float3 cubeR = normalize(r);
|
||||||
cubeR = boxProject(surface.P, surface.N, inProbePosArray[id], bbMinArray[id], bbMaxArray[id]);
|
cubeR = boxProject(surface.P, surface.N, inProbePosArray[id], bbMinArray[id], bbMaxArray[id]);
|
||||||
|
|
||||||
//float3 radiance = TORQUE_TEXCUBEARRAYLOD(cubeMap,cubeR,id,lod).xyz * (brdf.x + brdf.y);
|
float3 radiance = TORQUE_TEXCUBEARRAYLOD(cubeMap,cubeR,lod,id).xyz * (brdf.x + brdf.y);
|
||||||
float3 radiance = float3(1,1,1);
|
|
||||||
|
|
||||||
return radiance;
|
return radiance;
|
||||||
}
|
}
|
||||||
|
|
@ -150,7 +148,7 @@ float4 main( ConvexConnectP IN ) : SV_TARGET
|
||||||
blendVal[i] = max(0,blendVal[i]);
|
blendVal[i] = max(0,blendVal[i]);
|
||||||
}
|
}
|
||||||
blendSum += blendVal[i];
|
blendSum += blendVal[i];
|
||||||
invBlendSum +=(1.0f - blendVal[i]);
|
invBlendSum +=(1.0f - blendVal[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Weight0 = normalized NDF, inverted to have 1 at center, 0 at boundary.
|
// Weight0 = normalized NDF, inverted to have 1 at center, 0 at boundary.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue