Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devel #3204

Merged
merged 3 commits into from
Aug 29, 2024
Merged

Devel #3204

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Docs/14-Notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Since 14.1, `ACT_MATERIAL_LOD_INDEX` is available to implement multiple material

Since 14.3, textures defined in compositor scripts can explicitly set the FSAA level, e.g. `texture myTex fsaa 4`.

Since 14.3, `float16` vertex elements are supported via the `VET_HALFx` types. Note, that `VET_HALF3` is not supported on D3D11 and D3D9 and is padded to `VET_HALF4` on loading there.

### OgreUnifiedShader.h

Sampler definitions now implicitly include the `uniform` keyword to support Vulkan; i.e. this will generate an error:
Expand Down Expand Up @@ -87,6 +89,10 @@ The second argument of `RenderQueueListener::renderQueueStarted` now contains th

A new spot light type `LT_RECTLIGHT` has been introduced along with the `setSourceSize` method, enabling the rendering of rectangular area lights. In order to process this light type in your shader, verify that the `spotlight_params.w` autoparam is equal to 2. Then, `spotlight_params.xyz` contains the light width in the view space, and `light_attenuation.xyz` contains the light height.

### Mesh & Task Shaders (since 14.3)

The shader types `GPT_MESH_PROGRAM` and `GPT_TASK_PROGRAM` are now available, with support indicated by the `RSC_MESH_PROGRAM` capability. This functionality is provided in GL3Plus through the `GL_NV_mesh_shader` extension and in Vulkan via the `VK_NV_mesh_shader` extension.

## Python

The double `ImGui` namespacing in `Ogre.ImGui` enums was removed; e.g. `ImGui.ImGuiWindowFlags_NoTitleBar` is now `ImGui.WindowFlags_NoTitleBar`.
Expand Down Expand Up @@ -166,3 +172,7 @@ Transform feedback outputs are now consistently named `xfb_position`, `xfb_uv0`
Shader updates are required.

On OSX, `texture2D` etc. functions are no longer implicitly upgraded to version 150 equivalents, explicitly `#include <GLSL_GL3Support.glsl>` to get them.

## Wayland support (since 14.3)

Ogre can now run on Wayland in Linux if compiled with `OGRE_USE_WAYLAND=TRUE`. This is supported across all GL and Vulkan render systems, as well as the OgreBites SDL2 integration.
2 changes: 2 additions & 0 deletions Media/Main/OgreUnifiedShader.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ vec4 textureCubeLod(samplerCube s, vec3 v, float lod) { return texCUBElod(s, vec
#define mix lerp
#define fract frac
#define inversesqrt rsqrt
#define dFdx ddx
#define dFdy ddy

float mod(float _a, float _b) { return _a - _b * floor(_a / _b); }
vec2 mod(vec2 _a, vec2 _b) { return _a - _b * floor(_a / _b); }
Expand Down
20 changes: 1 addition & 19 deletions Samples/Emscripten/media/sample.material
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,4 @@ material Examples/Rockwall
}
}
}
}

material PSSM/shadow_caster
{
technique
{
// all this will do is write depth
pass
{
fog_override true none
depth_bias -1 -1

rtshader_system
{
lighting_stage gbuffer depth
}
}
}
}
}
8 changes: 0 additions & 8 deletions Samples/ShaderSystem/src/ShaderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -897,14 +897,6 @@ void Sample_ShaderSystem::applyShadowType(int menuIndex)
mTrayMgr->removeWidgetFromTray(mDirLightCheckBox);
mDirLightCheckBox->hide();

// Disable fog on the caster pass.
MaterialPtr passCaterMaterial = MaterialManager::getSingleton().getByName("PSSM/shadow_caster");
Pass* pssmCasterPass = passCaterMaterial->getTechnique(0)->getPass(0);
pssmCasterPass->setFog(true);

// Set up caster material - this is just a standard depth/shadow map caster
mSceneMgr->setShadowTextureCasterMaterial(passCaterMaterial);

// shadow camera setup
PSSMShadowCameraSetup* pssmSetup = new PSSMShadowCameraSetup();
pssmSetup->calculateSplitPoints(3, mCamera->getNearClipDistance(), mSceneMgr->getShadowFarDistance());
Expand Down
8 changes: 1 addition & 7 deletions Samples/Simple/include/Shadows.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ using namespace OgreBites;

// New depth shadowmapping
String CUSTOM_ROCKWALL_MATERIAL("Ogre/DepthShadowmap/Receiver/RockWall");
String CUSTOM_CASTER_MATERIAL("PSSM/shadow_caster");
String CUSTOM_ATHENE_MATERIAL("Ogre/DepthShadowmap/Receiver/Athene");

String BASIC_ROCKWALL_MATERIAL("Examples/Rockwall");
Expand Down Expand Up @@ -501,7 +500,7 @@ class _OgreSampleClassExport Sample_Shadows : public SdkSample

void updateDepthShadowParams()
{
auto mat = MaterialManager::getSingleton().getByName(CUSTOM_CASTER_MATERIAL);
auto mat = MaterialManager::getSingleton().getByName("Ogre/TextureShadowCaster");
auto pass = mat->getTechniques().back()->getPass(0);
pass->setDepthBias(-mFixedBiasSlider->getValue(), -mSlopedBiasSlider->getValue());
}
Expand All @@ -527,7 +526,6 @@ class _OgreSampleClassExport Sample_Shadows : public SdkSample
{
bool showSliders = false;
ShadowMaterial mat = (ShadowMaterial)mMaterialMenu->getSelectionIndex();
MaterialPtr themat;
if (mat != mCurrentMaterial)
{
switch(mat)
Expand All @@ -547,8 +545,6 @@ class _OgreSampleClassExport Sample_Shadows : public SdkSample
mSceneMgr->setShadowTexturePixelFormat(PF_DEPTH16);
mSceneMgr->setShadowTechnique(SHADOWTYPE_TEXTURE_ADDITIVE_INTEGRATED);

themat = MaterialManager::getSingleton().getByName(CUSTOM_CASTER_MATERIAL);
mSceneMgr->setShadowTextureCasterMaterial(themat);
mSceneMgr->setShadowTextureSelfShadow(true);
// Sort out base materials
pPlaneEnt->setMaterialName(CUSTOM_ROCKWALL_MATERIAL);
Expand All @@ -569,8 +565,6 @@ class _OgreSampleClassExport Sample_Shadows : public SdkSample
mSceneMgr->setShadowTexturePixelFormat(PF_DEPTH16);
mSceneMgr->setShadowTechnique(SHADOWTYPE_TEXTURE_ADDITIVE_INTEGRATED);

themat = MaterialManager::getSingleton().getByName(CUSTOM_CASTER_MATERIAL);
mSceneMgr->setShadowTextureCasterMaterial(themat);
mSceneMgr->setShadowTextureSelfShadow(true);
// Sort out base materials
pPlaneEnt->setMaterialName(CUSTOM_ROCKWALL_MATERIAL + "/PCF");
Expand Down
4 changes: 0 additions & 4 deletions Samples/Simple/include/Terrain.h
Original file line number Diff line number Diff line change
Expand Up @@ -595,9 +595,6 @@ class _OgreSampleClassExport Sample_Terrain : public SdkSample
subRenderState->setParameter("split_points",
static_cast<PSSMShadowCameraSetup*>(mPSSMSetup.get())->getSplitPoints());
schemRenderState->addTemplateSubRenderState(subRenderState);

mSceneMgr->setShadowTextureCasterMaterial(
MaterialManager::getSingleton().getByName("PSSM/shadow_caster"));
}
else
{
Expand All @@ -607,7 +604,6 @@ class _OgreSampleClassExport Sample_Terrain : public SdkSample
mSceneMgr->setShadowTextureConfig(2, 1024, 1024, PF_X8B8G8R8);
mSceneMgr->setShadowTextureSelfShadow(false);
mSceneMgr->setShadowCasterRenderBackFaces(false);
mSceneMgr->setShadowTextureCasterMaterial(MaterialPtr());
}

matProfile->setReceiveDynamicShadowsPSSM(static_cast<PSSMShadowCameraSetup*>(mPSSMSetup.get()));
Expand Down