I added dynamic cubemap support from the provided sample and I've notice that all compositors in the samples/tutorials that use "connect_external" don't also use automatic connections like "connect" and "connect_output". After that I tried to kind of "merge" also so SMAA sample.
After fixing some obvious issues I get it running with no crash, no error, but it just continues to show the previous compositor as if nothing changed. I know it has changed because the game continues to run in the background even though the loading screen compositor is still showing.
The following compositor might not be 1:1 with what I've done (I lost those files didn't make a commit of backup) but the idea is the same: can you connect_external then also expect the rest of the auto resolves to still work? Kind of rerunning the connectAllNodes() when it sees a change?
If what I did is a bad idea, how should I approach this better to have both dynamic cubemaps + SMAA? (not sure SMAA is actually worth it on mobile, but I kind of want to test the performance hit)
Code: Select all
compositor_node SkyboxSMAA_RenderingNode
{
//in 0 rt0
texture rt1 target_width target_height PF_R8G8B8A8
//Play nice with Multi-GPU setups. See Postprocessing sample.
target rt1
{
pass clear
{
colour_value 0 1 0 1
buffers colour
discard_only true
}
}
//out 0 rt0
out 1 rt1
}
compositor_node DefaultFinalComposition
{
in 0 rtN
// Take input texture #1 and use the local name "rtN" for reference in this scope
in 1 rt_output
// in 1 rt_renderwindow
target rt_output
{
//Play nice with Multi-GPU setups by telling the API there is no inter-frame dependency.
//On APIs that support discard_only (e.g. DX11) the driver may just ignore the colour value,
//and use a different memory region (i.e. the value read from a pixel of a discarded buffer
//without having written to it is undefined)
pass clear
{
colour_value 1 0 0 1
buffers colour
discard_only true
}
pass render_quad
{
//Ignore the alpha channel
material Ogre/Copy/4xFP32
input 0 rtN
}
pass render_scene
{
lod_update_list off
//Render Overlays
overlays on
rq_first 254
rq_last 255
}
}
}
abstract target cubemap_target_SkyboxWorkspace0
{
pass clear
{
colour_value 0 0 0 1
}
pass render_scene
{
//Filter stuff that shouldn't be reflected (vampires?)
visibility_mask 0x00000005
overlays off
camera_cubemap_reorient true
}
//Render sky (see TutorialSky_Postprocess)
pass render_quad
{
quad_normals camera_direction
material SkyPostprocess0
camera_cubemap_reorient true
}
}
compositor_node CubemapRendererNode_SkyboxWorkspace0
{
in 0 cubemap
target cubemap +X : cubemap_target_SkyboxWorkspace0 { }
target cubemap -X : cubemap_target_SkyboxWorkspace0 { }
target cubemap +Y : cubemap_target_SkyboxWorkspace0 { }
target cubemap -Y : cubemap_target_SkyboxWorkspace0 { }
target cubemap +Z : cubemap_target_SkyboxWorkspace0 { }
target cubemap -Z : cubemap_target_SkyboxWorkspace0
{
pass generate_mipmaps
{
}
}
}
compositor_node DynamicCubemapRenderingSkyboxNode0
{
texture rt0 target_width target_height PF_R8G8B8
//in 0 rt_renderwindow
in 0 demo_dynamic_cubemap
target rt0
{
pass clear
{
colour_value 0 0 0 0 1
}
pass render_scene
{
//Our materials in this pass will be using this cubemap,
//so we need to expose it to the pass.
//Note: Even if it "just works" without exposing, the reason for
//exposing is to ensure compatibility with Vulkan & D3D12.
expose demo_dynamic_cubemap
// shadows Tutorial_DynamicCubemapShadowNode
overlays off
rq_first 0
rq_last 2
}
//Render sky (see TutorialSky_Postprocess)
pass render_quad
{
quad_normals camera_direction
material SkyPostprocess0
}
//Render transparent stuff after sky
pass render_scene
{
overlays on
rq_first 2
}
}
out 0 rt0
}
workspace SkyboxWorkspace0
{
connect_external 0 DynamicCubemapRenderingSkyboxNode0 0
connect DynamicCubemapRenderingSkyboxNode0 0 SmaaNode 0
connect SkyboxSMAA_RenderingNode 1 SmaaNode 1
connect SmaaNode 0 DefaultFinalComposition 0
connect_output DefaultFinalComposition 1
}