Fixed publish rendering errors and improved shiny highlight shaders #393

Merged
Xenosas1337 merged 5 commits from SP3-1-Rendering into main 2023-03-04 16:01:18 +08:00
2 changed files with 23 additions and 17 deletions
Showing only changes of commit 13f28d6bdb - Show all commits

View File

@ -78,8 +78,14 @@ void main()
outEntityID = In2.eid; outEntityID = In2.eid;
lightLayerIndices = In2.lightLayerIndex; lightLayerIndices = In2.lightLayerIndex;
float vpHeight = float (In2.screenSpacePos.y) - MatProp.data[In2.materialIndex].highlightPosition; // float vpHeight = float (In2.screenSpacePos.y) - MatProp.data[In2.materialIndex].highlightPosition;
vpHeight = float (int (vpHeight) % genericDataBuffer.data.viewportHeight); // bring the frame of reference to the object's screen space pos
int scale = 470;
float vpHeight = float (In2.screenSpacePos.y);
float relativePos = float(int (-MatProp.data[In2.materialIndex].highlightPosition) % scale) - float (scale / 2);
vpHeight += relativePos;
// vpHeight = float (int (vpHeight) % genericDataBuffer.data.viewportHeight);
float scanlineScale = MatProp.data[In2.materialIndex].thickness * (1.0f - In2.screenSpacePos.z) * 100.0f; float scanlineScale = MatProp.data[In2.materialIndex].thickness * (1.0f - In2.screenSpacePos.z) * 100.0f;
float lowerLimit = vpHeight - scanlineScale; float lowerLimit = vpHeight - scanlineScale;

View File

@ -128,7 +128,7 @@ namespace SHADE
SHFreetypeInstance::Init(); SHFreetypeInstance::Init();
SHAssetManager::CompileAsset("../../Assets/Shaders/DeferredComposite_CS.glsl", false); //SHAssetManager::CompileAsset("../../Assets/Shaders/DeferredComposite_CS.glsl", false);
//SHAssetManager::CompileAsset("../../Assets/Shaders/ShadowMap_FS.glsl", false); //SHAssetManager::CompileAsset("../../Assets/Shaders/ShadowMap_FS.glsl", false);
//SHAssetManager::CompileAsset("../../Assets/Shaders/ShadowMap_FS.glsl", false); //SHAssetManager::CompileAsset("../../Assets/Shaders/ShadowMap_FS.glsl", false);
//SHAssetManager::CompileAsset("../../Assets/Shaders/SSAO_CS.glsl", false); //SHAssetManager::CompileAsset("../../Assets/Shaders/SSAO_CS.glsl", false);
@ -669,21 +669,21 @@ namespace SHADE
#endif #endif
} }
static bool shadowAdded = false; //static bool shadowAdded = false;
if (shadowAdded == false && SHInputManager::GetKey(SHInputManager::SH_KEYCODE::B)) //if (shadowAdded == false && SHInputManager::GetKey(SHInputManager::SH_KEYCODE::B))
{ //{
shadowAdded = true; // shadowAdded = true;
auto& lightComps = SHComponentManager::GetDense<SHLightComponent>(); // auto& lightComps = SHComponentManager::GetDense<SHLightComponent>();
//if (lightComps.size() > 2) // //if (lightComps.size() > 2)
//{ // //{
// lightComps[2].SetEnableShadow(true); // // lightComps[2].SetEnableShadow(true);
//} // //}
for (auto& comp : lightComps) // for (auto& comp : lightComps)
{ // {
comp.SetEnableShadow(true); // comp.SetEnableShadow(true);
} // }
} //}
renderGraph->Begin(frameIndex); renderGraph->Begin(frameIndex);
auto cmdBuffer = renderGraph->GetCommandBuffer(frameIndex); auto cmdBuffer = renderGraph->GetCommandBuffer(frameIndex);