diff --git a/.gitignore b/.gitignore index c968f47c7..e4c55cefb 100644 --- a/.gitignore +++ b/.gitignore @@ -68,6 +68,7 @@ local.properties .builds *.dotCover *.dll +!d3dcompiler_47.dll *.lib *.exp *.exe diff --git a/Engine/source/console/simManager.cpp b/Engine/source/console/simManager.cpp index d81704d89..663ed79e1 100644 --- a/Engine/source/console/simManager.cpp +++ b/Engine/source/console/simManager.cpp @@ -436,7 +436,7 @@ SimObject *spawnObject(String spawnClass, String spawnDataBlock, String spawnNam // If we have a spawn script go ahead and execute it last if (spawnScript.isNotEmpty()) - Con::evaluate(spawnScript.c_str(), true); + Con::evaluate(spawnScript.c_str()); return spawnObject; } diff --git a/Engine/source/environment/sun.cpp b/Engine/source/environment/sun.cpp index 4237a34f7..c7ffefa05 100644 --- a/Engine/source/environment/sun.cpp +++ b/Engine/source/environment/sun.cpp @@ -61,7 +61,7 @@ Sun::Sun() mTypeMask = EnvironmentObjectType | LightObjectType | StaticObjectType; mLightColor.set(0.7f, 0.7f, 0.7f); - mLightAmbient.set(0.3f, 0.3f, 0.3f); + mLightAmbient.set(1.0f, 1.0f, 1.0f); mBrightness = 1.0f; mSunAzimuth = 0.0f; mSunElevation = 35.0f; diff --git a/Engine/source/gui/editor/inspector/dynamicField.cpp b/Engine/source/gui/editor/inspector/dynamicField.cpp index cebaa890a..477768c5a 100644 --- a/Engine/source/gui/editor/inspector/dynamicField.cpp +++ b/Engine/source/gui/editor/inspector/dynamicField.cpp @@ -74,7 +74,7 @@ void GuiInspectorDynamicField::setData( const char* data, bool callbacks ) { target->inspectPreApply(); - if( callbacks ) + if( callbacks && !mField->flag.test(AbstractClassRep::FieldFlags::FIELD_ComponentInspectors)) { if( isRemoval ) Con::executef( mInspector, "onFieldRemoved", target->getIdString(), mDynField->slotName ); diff --git a/Engine/source/gui/editor/inspector/field.cpp b/Engine/source/gui/editor/inspector/field.cpp index 34fe76c80..35f85f405 100644 --- a/Engine/source/gui/editor/inspector/field.cpp +++ b/Engine/source/gui/editor/inspector/field.cpp @@ -378,7 +378,7 @@ void GuiInspectorField::setData( const char* data, bool callbacks ) // Fire callback single-object undo. - if( callbacks ) + if( callbacks && !mField->flag.test(AbstractClassRep::FieldFlags::FIELD_ComponentInspectors) ) Con::executef( mInspector, "onInspectorFieldModified", target->getIdString(), mField->pFieldname, diff --git a/Engine/source/lighting/advanced/advancedLightBinManager.cpp b/Engine/source/lighting/advanced/advancedLightBinManager.cpp index fd8cd6dc4..c857933dd 100644 --- a/Engine/source/lighting/advanced/advancedLightBinManager.cpp +++ b/Engine/source/lighting/advanced/advancedLightBinManager.cpp @@ -790,7 +790,7 @@ void AdvancedLightBinManager::LightMaterialInfo::setLightParameters( const Light MaterialParameters *matParams = matInstance->getMaterialParameters(); matParams->setSafe( lightColor, lightInfo->getColor() ); - matParams->setSafe(lightBrightness, lightInfo->getBrightness() * lightInfo->getFadeAmount()); + F32 luxTargMultiplier = 1; switch( lightInfo->getType() ) { @@ -804,10 +804,10 @@ void AdvancedLightBinManager::LightMaterialInfo::setLightParameters( const Light case LightInfo::Spot: { const F32 outerCone = lightInfo->getOuterConeAngle(); - const F32 innerCone = getMin(lightInfo->getInnerConeAngle(), outerCone); + const F32 innerCone = getMin(lightInfo->getInnerConeAngle(), outerCone-0.0001f); const F32 outerCos = mCos(mDegToRad(outerCone / 2.0f)); const F32 innerCos = mCos(mDegToRad(innerCone / 2.0f)); - Point2F spotParams(outerCos,innerCos - outerCos); + Point2F spotParams(outerCos,mMax(innerCos - outerCos,0.001f)); matParams->setSafe( lightSpotParams, spotParams ); matParams->setSafe( lightDirection, lightInfo->getDirection()); @@ -817,6 +817,9 @@ void AdvancedLightBinManager::LightMaterialInfo::setLightParameters( const Light const F32 invSqrRadius = 1.0f / mSquared(radius); matParams->setSafe(lightRange, radius); matParams->setSafe(lightInvSqrRange, invSqrRadius); + + F32 concentration = 360.0f/ outerCone; + luxTargMultiplier = radius * concentration; } break; @@ -828,6 +831,7 @@ void AdvancedLightBinManager::LightMaterialInfo::setLightParameters( const Light const F32 invSqrRadius = 1.0f / (radius * radius); matParams->setSafe( lightRange, radius); matParams->setSafe( lightInvSqrRange, invSqrRadius); + luxTargMultiplier =radius; } break; @@ -835,6 +839,7 @@ void AdvancedLightBinManager::LightMaterialInfo::setLightParameters( const Light AssertFatal( false, "Bad light type!" ); break; } + matParams->setSafe(lightBrightness, lightInfo->getBrightness()* lightInfo->getFadeAmount() * luxTargMultiplier); } bool LightMatInstance::setupPass( SceneRenderState *state, const SceneData &sgData ) diff --git a/Engine/source/lighting/lightManager.cpp b/Engine/source/lighting/lightManager.cpp index d0652a62f..ac331ba4d 100644 --- a/Engine/source/lighting/lightManager.cpp +++ b/Engine/source/lighting/lightManager.cpp @@ -333,7 +333,7 @@ void LightManager::_update4LightConsts( const SceneData &sgData, static AlignedArray lightSpotDirs(MAX_FORWARD_LIGHTS, sizeof(Point4F)); static AlignedArray lightColors(MAX_FORWARD_LIGHTS, sizeof(Point4F)); static AlignedArray lightConfigData(MAX_FORWARD_LIGHTS, sizeof(Point4F)); //type, brightness, range, invSqrRange : rgba - static AlignedArray lightSpotParams(MAX_FORWARD_LIGHTS, sizeof(Point2F)); + static AlignedArray lightSpotParams(MAX_FORWARD_LIGHTS, sizeof(Point4F)); dMemset(lightPositions.getBuffer(), 0, lightPositions.getBufferSize()); dMemset(lightSpotDirs.getBuffer(), 0, lightSpotDirs.getBufferSize()); @@ -352,11 +352,12 @@ void LightManager::_update4LightConsts( const SceneData &sgData, vectorLightDirection = Point4F::Zero; vectorLightColor = Point4F::Zero; vectorLightAmbientColor = Point4F::Zero; - + F32 luxTargMultiplier[MAX_FORWARD_LIGHTS]; // Gather the data for the first 4 lights. const LightInfo* light; for (U32 i = 0; i < MAX_FORWARD_LIGHTS; i++) { + luxTargMultiplier[i] = 1.0; light = sgData.lights[i]; if (!light) break; @@ -371,48 +372,52 @@ void LightManager::_update4LightConsts( const SceneData &sgData, vectorLightColor = Point4F(light->getColor()); vectorLightAmbientColor = Point4F(light->getAmbient()); hasVectorLight = 1; - continue; } - - // The light positions and spot directions are - // in SoA order to make optimal use of the GPU. - const Point3F& lightPos = light->getPosition(); - lightPositions[i].x = lightPos.x; - lightPositions[i].y = lightPos.y; - lightPositions[i].z = lightPos.z; - lightPositions[i].w = 0; - - const VectorF& lightDir = light->getDirection(); - lightSpotDirs[i].x = lightDir.x; - lightSpotDirs[i].y = lightDir.y; - lightSpotDirs[i].z = lightDir.z; - lightSpotDirs[i].w = 0; - - lightColors[i] = Point4F(light->getColor()); - - if (light->getType() == LightInfo::Point) + else { - lightConfigData[i].x = 0; + // The light positions and spot directions are + // in SoA order to make optimal use of the GPU. + const Point3F& lightPos = light->getPosition(); + lightPositions[i].x = lightPos.x; + lightPositions[i].y = lightPos.y; + lightPositions[i].z = lightPos.z; + lightPositions[i].w = 0; + + lightColors[i] = Point4F(light->getColor()); + + F32 range = light->getRange().x; + lightConfigData[i].z = range; + + if (light->getType() == LightInfo::Point) + { + lightConfigData[i].x = 0; + luxTargMultiplier[i] = range; + } + else if (light->getType() == LightInfo::Spot) + { + const VectorF& lightDir = light->getDirection(); + lightSpotDirs[i].x = lightDir.x; + lightSpotDirs[i].y = lightDir.y; + lightSpotDirs[i].z = lightDir.z; + lightSpotDirs[i].w = 0; + + lightConfigData[i].x = 1; + + const F32 outerCone = light->getOuterConeAngle(); + const F32 innerCone = getMin(light->getInnerConeAngle(), outerCone - 0.0001f); + const F32 outerCos = mCos(mDegToRad(outerCone / 2.0f)); + const F32 innerCos = mCos(mDegToRad(innerCone / 2.0f)); + Point2F spotParams(outerCos, mMax(innerCos - outerCos, 0.001f)); + + lightSpotParams[i].x = spotParams.x; + lightSpotParams[i].y = spotParams.y; + F32 concentration = 360.0f / outerCone; + luxTargMultiplier[i] = range * concentration; + } + + lightConfigData[i].y = light->getBrightness() * luxTargMultiplier[i]; + lightConfigData[i].w = 1.0f / (range * range); } - else if (light->getType() == LightInfo::Spot) - { - lightConfigData[i].x = 1; - - const F32 outerCone = light->getOuterConeAngle(); - const F32 innerCone = getMin(light->getInnerConeAngle(), outerCone); - const F32 outerCos = mCos(mDegToRad(outerCone / 2.0f)); - const F32 innerCos = mCos(mDegToRad(innerCone / 2.0f)); - Point2F spotParams(outerCos, innerCos - outerCos); - - lightSpotParams[i].x = spotParams.x; - lightSpotParams[i].y = spotParams.y; - } - - lightConfigData[i].y = light->getBrightness(); - - F32 range = light->getRange().x; - lightConfigData[i].z = range; - lightConfigData[i].w = 1.0f / (range * range); } shaderConsts->setSafe(lightPositionSC, lightPositions); diff --git a/Engine/source/lighting/shadowMap/singleLightShadowMap.cpp b/Engine/source/lighting/shadowMap/singleLightShadowMap.cpp index cd4724838..4f246bec8 100644 --- a/Engine/source/lighting/shadowMap/singleLightShadowMap.cpp +++ b/Engine/source/lighting/shadowMap/singleLightShadowMap.cpp @@ -71,7 +71,8 @@ void SingleLightShadowMap::_render( RenderPassManager* renderPass, lightMatrix.inverse(); GFX->setWorldMatrix(lightMatrix); - const MatrixF& lightProj = GFX->getProjectionMatrix(); + MatrixF lightProj = GFX->getProjectionMatrix(); + lightProj.reverseProjection(); mWorldToLightProj = lightProj * lightMatrix; // Render the shadowmap! diff --git a/Templates/BaseGame/CMakeLists.txt b/Templates/BaseGame/CMakeLists.txt index fb5fea3e1..95bb0a42d 100644 --- a/Templates/BaseGame/CMakeLists.txt +++ b/Templates/BaseGame/CMakeLists.txt @@ -4,8 +4,15 @@ foreach(TEMPLATE_FILE ${TEMPLATE_FILES}) endforeach() # Perform installation minus scripts -file(COPY "game" "source" DESTINATION "${TORQUE_APP_ROOT_DIRECTORY}" PATTERN "*.tscript" EXCLUDE PATTERN - PATTERN "*.in" EXCLUDE PATTERN) +if(WIN32) + file(COPY "game" "source" DESTINATION "${TORQUE_APP_ROOT_DIRECTORY}" PATTERN "*.tscript" EXCLUDE + PATTERN "*.in" EXCLUDE) +else() + file(COPY "game" "source" DESTINATION "${TORQUE_APP_ROOT_DIRECTORY}" PATTERN "*.tscript" EXCLUDE + PATTERN "*.in" EXCLUDE + PATTERN "*.dll" EXCLUDE) +endif(WIN32) + # Enumerate scripts and install with extension file(GLOB_RECURSE SCRIPT_FILES "game/*.tscript") foreach(ITEM ${SCRIPT_FILES}) diff --git a/Templates/BaseGame/game/D3DCompiler_47.dll b/Templates/BaseGame/game/D3DCompiler_47.dll new file mode 100644 index 000000000..e61c5aea8 Binary files /dev/null and b/Templates/BaseGame/game/D3DCompiler_47.dll differ diff --git a/Templates/BaseGame/game/core/postFX/scripts/HDR/HDRPostFX.tscript b/Templates/BaseGame/game/core/postFX/scripts/HDR/HDRPostFX.tscript index a3c459e6f..b15f48d61 100644 --- a/Templates/BaseGame/game/core/postFX/scripts/HDR/HDRPostFX.tscript +++ b/Templates/BaseGame/game/core/postFX/scripts/HDR/HDRPostFX.tscript @@ -26,11 +26,7 @@ $PostFX::HDRPostFX::enableToneMapping = 0.5; /// The tone mapping middle grey or exposure value used /// to adjust the overall "balance" of the image. -/// -/// 0.18 is fairly common value. -/// - -$PostFX::HDRPostFX::keyValue = 0.115; +$PostFX::HDRPostFX::keyValue = 0.5; //Explicit HDR Params diff --git a/Templates/BaseGame/game/core/rendering/shaders/brdf.hlsl b/Templates/BaseGame/game/core/rendering/shaders/brdf.hlsl index e18d1d0be..e36762e6e 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/brdf.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/brdf.hlsl @@ -73,4 +73,14 @@ float D_GGX(float NdotH, float alphaRoughnessSq) return alphaRoughnessSq / (M_PI_F * f * f); } +float3 Fr_DisneyDiffuse(float3 F0, float NdotV, float NdotL, float LdotH, float linearRoughness) +{ + float energyBias = lerp (0 , 0.5 , linearRoughness ); + float energyFactor = lerp (1.0 , 1.0 / 1.51 , linearRoughness ); + float fd90 = energyBias + 2.0 * LdotH * LdotH * linearRoughness ; + float3 lightScatter = F_Schlick( F0 , fd90 , NdotL ); + float3 viewScatter = F_Schlick(F0 , fd90 , NdotV ); + + return lightScatter * viewScatter * energyFactor ; +} #endif diff --git a/Templates/BaseGame/game/core/rendering/shaders/gl/brdf.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/brdf.glsl index dbe4d50ac..9d76de406 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/gl/brdf.glsl +++ b/Templates/BaseGame/game/core/rendering/shaders/gl/brdf.glsl @@ -67,4 +67,15 @@ float D_GGX(float NdotH, float alphaRoughnessSq) return alphaRoughnessSq / (M_PI_F * f * f); } +vec3 Fr_DisneyDiffuse(vec3 F0, float NdotV, float NdotL, float LdotH, float linearRoughness) +{ + float energyBias = lerp(0 , 0.5 , linearRoughness ); + float energyFactor = lerp(1.0 , 1.0 / 1.51 , linearRoughness ); + float fd90 = energyBias + 2.0 * LdotH * LdotH * linearRoughness ; + vec3 lightScatter = F_Schlick( F0 , fd90 , NdotL ); + vec3 viewScatter = F_Schlick(F0 , fd90 , NdotV ); + + return lightScatter * viewScatter * energyFactor ; +} + #endif diff --git a/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl b/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl index a903c0896..f430c0e35 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl +++ b/Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl @@ -216,15 +216,15 @@ float getDistanceAtt( vec3 unormalizedLightVector , float invSqrAttRadius ) float getSpotAngleAtt( vec3 normalizedLightVector , vec3 lightDir , vec2 lightSpotParams ) { - float cd = dot ( lightDir , normalizedLightVector ); - float attenuation = saturate ( ( cd - lightSpotParams.x ) / lightSpotParams.y ); + float cd = max(dot( lightDir , normalizedLightVector ),0.0); + float attenuation = saturate ( ( cd - lightSpotParams.x/(cd*1.001) ) / lightSpotParams.y ); // smooth the transition return sqr(attenuation); } vec3 evaluateStandardBRDF(Surface surface, SurfaceToLight surfaceToLight) { - //lambert diffuse + //diffuse term vec3 Fd = surface.albedo.rgb * M_1OVER_PI_F; //GGX specular @@ -236,7 +236,7 @@ vec3 evaluateStandardBRDF(Surface surface, SurfaceToLight surfaceToLight) #if CAPTURING == 1 return saturate(mix(Fd + Fr,surface.f0,surface.metalness)); #else - return saturate(Fd + Fr); + return Fd + Fr; #endif } @@ -254,6 +254,15 @@ vec3 getPunctualLight(Surface surface, SurfaceToLight surfaceToLight, vec3 light return evaluateStandardBRDF(surface,surfaceToLight) * factor; } +vec3 getSpotlight(Surface surface, SurfaceToLight surfaceToLight, vec3 lightColor, float lightIntensity, float radius, vec3 lightDir, vec2 lightSpotParams, float shadow) +{ + float attenuation = 1.0f; + attenuation *= getDistanceAtt(surfaceToLight.Lu, radius); + attenuation *= getSpotAngleAtt(-surfaceToLight.L, lightDir, lightSpotParams.xy); + vec3 factor = lightColor * max(surfaceToLight.NdotL* shadow * lightIntensity * attenuation, 0.0f) ; + return evaluateStandardBRDF(surface,surfaceToLight) * factor; +} + float computeSpecOcclusion( float NdotV , float AO , float roughness ) { return saturate (pow( abs(NdotV + AO) , exp2 ( -16.0f * roughness - 1.0f )) - 1.0f + AO ); @@ -270,7 +279,7 @@ vec4 compute4Lights( Surface surface, vec4 inLightConfigData[4], vec4 inLightColor[4], vec4 inLightSpotDir[4], - vec2 lightSpotParams[4], + vec2 inlightSpotParams[4], int hasVectorLight, vec4 vectorLightDirection, vec4 vectorLightingColor, @@ -305,13 +314,10 @@ vec4 compute4Lights( Surface surface, //get punctual light contribution lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadowed); } - else //spot + else if(inLightConfigData[i].x == 1) //spot { - - //get Punctual light contribution - lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadowed); - //get spot angle attenuation - lighting *= getSpotAngleAtt(-surfaceToLight.L, inLightSpotDir[i].xyz, lightSpotParams[i].xy ); + //get spot light contribution + lighting = getSpotlight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, inLightSpotDir[i].xyz, inlightSpotParams[i], shadowed); } } finalLighting += lighting; diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl index 0a0f1b967..a2004bd4d 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl @@ -217,15 +217,15 @@ float getDistanceAtt( float3 unormalizedLightVector , float invSqrAttRadius ) float getSpotAngleAtt( float3 normalizedLightVector , float3 lightDir , float2 lightSpotParams ) { - float cd = dot ( lightDir , normalizedLightVector ); - float attenuation = saturate ( ( cd - lightSpotParams.x ) / lightSpotParams.y ); + float cd = max(dot ( lightDir , normalizedLightVector ),0.0); + float attenuation = saturate(((cd - lightSpotParams.x/(cd*1.001))/lightSpotParams.y)); // smooth the transition return sqr(attenuation); } float3 evaluateStandardBRDF(Surface surface, SurfaceToLight surfaceToLight) { - //lambert diffuse + //diffuse term float3 Fd = surface.albedo.rgb * M_1OVER_PI_F; //GGX specular @@ -237,7 +237,7 @@ float3 evaluateStandardBRDF(Surface surface, SurfaceToLight surfaceToLight) #if CAPTURING == 1 return saturate(lerp(Fd + Fr,surface.f0,surface.metalness)); #else - return saturate(Fd + Fr); + return Fd + Fr; #endif } @@ -255,6 +255,14 @@ float3 getPunctualLight(Surface surface, SurfaceToLight surfaceToLight, float3 l return evaluateStandardBRDF(surface,surfaceToLight) * factor; } +float3 getSpotlight(Surface surface, SurfaceToLight surfaceToLight, float3 lightColor, float lightIntensity, float radius, float3 lightDir, float2 lightSpotParams, float shadow) +{ + float attenuation = 1.0f; + attenuation *= getDistanceAtt(surfaceToLight.Lu, radius); + attenuation *= getSpotAngleAtt(-surfaceToLight.L, lightDir, lightSpotParams.xy); + float3 factor = lightColor * max(surfaceToLight.NdotL* shadow * lightIntensity * attenuation, 0.0f) ; + return evaluateStandardBRDF(surface,surfaceToLight) * factor; +} float computeSpecOcclusion( float NdotV , float AO , float roughness ) { return saturate (pow( abs(NdotV + AO) , exp2 ( -16.0f * roughness - 1.0f )) - 1.0f + AO ); @@ -271,7 +279,7 @@ float4 compute4Lights( Surface surface, float4 inLightConfigData[4], float4 inLightColor[4], float4 inLightSpotDir[4], - float2 lightSpotParams[4], + float2 inlightSpotParams[4], int hasVectorLight, float4 vectorLightDirection, float4 vectorLightingColor, @@ -296,7 +304,7 @@ float4 compute4Lights( Surface surface, float lightBrightness = inLightConfigData[i].y; float lightInvSqrRange= inLightConfigData[i].a; - float3 lighting = 0.0.xxx; + float3 lighting = float3(0.0,0.0,0.0); [branch] if(dist < lightRange) @@ -307,13 +315,10 @@ float4 compute4Lights( Surface surface, //get punctual light contribution lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadowed); } - else //spot + else if(inLightConfigData[i].x == 1) //spot { - - //get Punctual light contribution - lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadowed); - //get spot angle attenuation - lighting *= getSpotAngleAtt(-surfaceToLight.L, inLightSpotDir[i].xyz, lightSpotParams[i].xy ); + //get spot light contribution + lighting = getSpotlight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, inLightSpotDir[i].xyz, inlightSpotParams[i], shadowed); } } finalLighting += lighting; @@ -321,7 +326,7 @@ float4 compute4Lights( Surface surface, //Vector light [branch] - if(hasVectorLight) + if(hasVectorLight == 1) { SurfaceToLight surfaceToVecLight = createSurfaceToLight(surface, -vectorLightDirection.xyz); diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/spotLightP.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/spotLightP.glsl index 1a7c42822..42654c532 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/spotLightP.glsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/spotLightP.glsl @@ -154,10 +154,8 @@ void main() return; #endif - //get Punctual light contribution - lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadow); - //get spot angle attenuation - lighting *= getSpotAngleAtt(-surfaceToLight.L, lightDirection, lightSpotParams ); + //get spot light contribution + lighting = getSpotlight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, lightDirection, lightSpotParams, shadow); } OUT_col = vec4(lighting, 0); diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/spotLightP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/spotLightP.hlsl index a78ed019b..d4ef36a36 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/spotLightP.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/spotLightP.hlsl @@ -151,10 +151,8 @@ float4 main( ConvexConnectP IN ) : SV_TARGET return final; #endif - //get Punctual light contribution - lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadow); - //get spot angle attenuation - lighting *= getSpotAngleAtt(-surfaceToLight.L, lightDirection, lightSpotParams ); + //get spot light contribution + lighting = getSpotlight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, lightDirection, lightSpotParams, shadow); } return float4(lighting, 0); diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/ArrowPrimitive.asset.taml b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/ArrowPrimitive.asset.taml new file mode 100644 index 000000000..4dd762c17 --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/ArrowPrimitive.asset.taml @@ -0,0 +1,5 @@ + diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/ArrowPrimitive.fbx b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/ArrowPrimitive.fbx new file mode 100644 index 000000000..d0a9af823 Binary files /dev/null and b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/ArrowPrimitive.fbx differ diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/ArrowPrimitive.tscript b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/ArrowPrimitive.tscript new file mode 100644 index 000000000..97f5ac066 --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Primitives/ArrowPrimitive.tscript @@ -0,0 +1,8 @@ + +singleton TSShapeConstructor(ArrowPrimitivefbx) +{ + baseShapeAsset = "Prototyping:ArrowPrimitive"; + singleDetailSize = "0"; + neverImportMat = "DefaultMaterial ColorEffect*"; + animFPS = "2"; +}; diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Reference/ColorCalibrationChart.png b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/ColorCalibrationChart.png new file mode 100644 index 000000000..4d45d2585 Binary files /dev/null and b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/ColorCalibrationChart.png differ diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Reference/ColorCalibrationChart_image.asset.taml b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/ColorCalibrationChart_image.asset.taml new file mode 100644 index 000000000..da4d0f1fa --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/ColorCalibrationChart_image.asset.taml @@ -0,0 +1,3 @@ + diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Reference/ColorCalibration_mat.asset.taml b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/ColorCalibration_mat.asset.taml new file mode 100644 index 000000000..21ea3ed5b --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/ColorCalibration_mat.asset.taml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Reference/MaterialGrid.asset.taml b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/MaterialGrid.asset.taml new file mode 100644 index 000000000..be367def9 --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/MaterialGrid.asset.taml @@ -0,0 +1,16 @@ + + + + + + + + diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Reference/MaterialGrid.fbx b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/MaterialGrid.fbx new file mode 100644 index 000000000..5389ce531 Binary files /dev/null and b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/MaterialGrid.fbx differ diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Reference/MaterialGrid.fbx_imposter.dds b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/MaterialGrid.fbx_imposter.dds new file mode 100644 index 000000000..c924508d0 Binary files /dev/null and b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/MaterialGrid.fbx_imposter.dds differ diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Reference/MaterialGrid.fbx_imposter_normals.dds b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/MaterialGrid.fbx_imposter_normals.dds new file mode 100644 index 000000000..12cbf4fed Binary files /dev/null and b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/MaterialGrid.fbx_imposter_normals.dds differ diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Reference/MaterialGrid_shape.asset.taml b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/MaterialGrid_shape.asset.taml new file mode 100644 index 000000000..a518ecf9b --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/MaterialGrid_shape.asset.taml @@ -0,0 +1 @@ + diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Reference/colorCalibrationCard.dae b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/colorCalibrationCard.dae new file mode 100644 index 000000000..26ff0651d --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/colorCalibrationCard.dae @@ -0,0 +1,115 @@ + + + + + Blender User + Blender 4.0.1 commit date:2023-11-16, commit time:16:40, hash:d0dd92834a08 + + 2023-11-28T06:31:25 + 2023-11-28T06:31:25 + + Z_UP + + + + + + + ColorCalibrationChart_png + + + + + ColorCalibrationChart_png-surface + + + + + + 0 0 0 1 + + + + + + 1.45 + + + + + + + + + ColorCalibrationChart.png + + + + + + + + + + + + -3 -2 -0.125 3 -2 -0.125 -3 2 -0.125 3 2 -0.125 -3 -2 0.09394234 -2.906827 -1.937885 0.125 -2.972711 -1.981807 0.1159034 3 -2 0.09394234 2.906827 -1.937885 0.125 2.972711 -1.981807 0.1159034 -2.906827 1.937885 0.125 -3 2 0.09394234 -2.972711 1.981807 0.1159034 3 2 0.09394234 2.906827 1.937885 0.125 2.972711 1.981807 0.1159034 + + + + + + + + + + 0 -1 0 0 0 -1 0.04734104 -0.08288294 0.9954342 -0.04734104 0.08288294 0.9954342 -0.04734086 -0.08288335 0.9954342 1 0 0 0 1 0 -0.6269479 0 0.7790613 -0.6269475 0 0.7790615 -0.6269475 0 0.7790616 -0.08579593 -0.07703024 0.9933305 -0.08579528 0.07703095 0.9933305 0 -0.7700822 0.6379447 0 -0.7700783 0.6379494 0.08579528 -0.07703095 0.9933305 0.6269479 0 0.7790613 0.6269475 0 0.7790615 0.6269475 0 0.7790616 0.08579593 0.07703024 0.9933305 0 0.7700822 0.6379447 0 0.7700783 0.6379494 0.04734086 0.08288335 0.9954342 -1 0 0 0 -0.7700822 0.6379448 0 0.7700822 0.6379448 + + + + + + + + + + 0 0 1 0 1 0 0 1 1 0 0 0 0.9844712 0.01552879 0.01552879 0.9844712 0.01552879 0.01552879 1 0 1 1 1 1 1 1 0 1 0 1 0 0 0.002274096 0.9977259 0 1 0.002274096 0.002274096 0.01552879 0.9844712 0.002274096 0.9977259 1 0 0.002274096 0.002274096 0 0 0.9977259 0.002274096 0.01552879 0.01552879 0.002274096 0.002274096 1 1 0.9977259 0.002274096 1 0 0.9977259 0.9977259 0.9844712 0.01552879 0.9977259 0.002274096 0 1 0.9977259 0.9977259 1 1 0.002274096 0.9977259 0.9844712 0.9844712 0.9977259 0.9977259 0 1 0 0 0 0 0 0 0 0 1 0 0 1 1 1 1 0 0.9844712 0.01552879 0.9844712 0.9844712 0.01552879 0.9844712 1 0 1 0 1 1 1 1 1 1 0 1 0 0 0.002274096 0.002274096 0.002274096 0.9977259 0.002274096 0.002274096 0.01552879 0.01552879 0.01552879 0.9844712 1 0 0.9977259 0.002274096 0.002274096 0.002274096 0.9977259 0.002274096 0.9844712 0.01552879 0.01552879 0.01552879 1 1 0.9977259 0.9977259 0.9977259 0.002274096 0.9977259 0.9977259 0.9844712 0.9844712 0.9844712 0.01552879 0 1 0.002274096 0.9977259 0.9977259 0.9977259 0.002274096 0.9977259 0.01552879 0.9844712 0.9844712 0.9844712 0 1 0 1 0 0 + + + + + + + + + + + + + + +

4 0 0 1 0 1 7 0 2 2 1 3 1 1 4 0 1 5 8 2 6 10 3 7 5 4 8 7 5 9 3 5 10 13 5 11 13 6 12 2 6 13 11 6 14 4 7 15 12 8 16 11 9 17 6 10 18 10 3 19 12 11 20 7 12 21 6 13 22 4 13 23 9 14 24 5 4 25 6 10 26 13 15 27 9 16 28 7 17 29 15 18 30 8 2 31 9 14 32 11 19 33 15 20 34 13 20 35 12 11 36 14 21 37 15 18 38 11 22 39 0 22 40 4 22 41 4 0 42 0 0 43 1 0 44 2 1 45 3 1 46 1 1 47 8 2 48 14 21 49 10 3 50 7 5 51 1 5 52 3 5 53 13 6 54 3 6 55 2 6 56 4 7 57 6 7 58 12 8 59 6 10 60 5 4 61 10 3 62 7 12 63 9 23 64 6 13 65 9 14 66 8 2 67 5 4 68 13 15 69 15 15 70 9 16 71 15 18 72 14 21 73 8 2 74 11 19 75 12 24 76 15 20 77 12 11 78 10 3 79 14 21 80 11 22 81 2 22 82 0 22 83

+
+
+
+
+ + + + 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Reference/colorCalibrationCard.tscript b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/colorCalibrationCard.tscript new file mode 100644 index 000000000..3b98259b8 --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/colorCalibrationCard.tscript @@ -0,0 +1,12 @@ + +singleton TSShapeConstructor(colorCalibrationCarddae) +{ + baseShapeAsset = ":colorCalibrationCard_shape"; + singleDetailSize = "0"; + neverImportMat = "DefaultMaterial ColorEffect*"; + flipUVCoords = "0"; + joinIdenticalVerts = "0"; + reverseWindingOrder = "0"; + removeRedundantMats = "0"; + animFPS = "2"; +}; diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Reference/colorCalibrationCard_shape.asset.taml b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/colorCalibrationCard_shape.asset.taml new file mode 100644 index 000000000..092dd88f0 --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/colorCalibrationCard_shape.asset.taml @@ -0,0 +1,5 @@ + diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Reference/materialGrid_ORM.png b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/materialGrid_ORM.png new file mode 100644 index 000000000..148b4aa88 Binary files /dev/null and b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/materialGrid_ORM.png differ diff --git a/Templates/BaseGame/game/data/Prototyping/shapes/Reference/materialGrid_ORM_image.asset.taml b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/materialGrid_ORM_image.asset.taml new file mode 100644 index 000000000..fda774c35 --- /dev/null +++ b/Templates/BaseGame/game/data/Prototyping/shapes/Reference/materialGrid_ORM_image.asset.taml @@ -0,0 +1 @@ + diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui index 735275523..f64982991 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui @@ -1105,7 +1105,7 @@ $guiContent = new GuiControl(AssetBrowser) { groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; - position = "120 340"; + position = getWord($pref::Video::mode, 0) - 420 SPC 340; extent = "53 19"; minExtent = "8 2"; horizSizing = "left"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui index 1a153dabb..4c8feacfa 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui @@ -31,7 +31,7 @@ $guiContent = new GuiContainer(EditorGui,EditorGuiGroup) { new GuiTabPageCtrl(MainSceneEditorTab) { text = "Main Scene"; - position = 0 SPC $MainEditor::TabHeight; + position = 0 SPC 20; extent = 800 SPC 580; horizSizing = "width"; vertSizing = "height"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorTreeWindow.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorTreeWindow.ed.gui index 51692048c..735b9b070 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorTreeWindow.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorTreeWindow.ed.gui @@ -131,7 +131,7 @@ $guiContent = new GuiControl() { HorizSizing = "width"; VertSizing = "height"; Position = "5 29"; - Extent = "300 271"; + Extent = "290 240"; MinExtent = "8 8"; canSave = "1"; Visible = "1";