Bloom & other post-processing effects in TX2D?
by Matt Simpson · in Torque X 2D · 06/21/2010 (11:27 am) · 4 replies
Hi All
Could someone please give me the low-down on how Bloom and other post-processing shader effects work in Torque X 2D?
Many thanks!
Matt
Could someone please give me the low-down on how Bloom and other post-processing shader effects work in Torque X 2D?
Many thanks!
Matt
About the author
Recent Threads
#2
Thanks for your reply.
I've dug into the code and got bloom working. Cheers!
06/22/2010 (10:29 am)
Hi DuncanThanks for your reply.
I've dug into the code and got bloom working. Cheers!
#3
I've got the bloom effect working, but it's causing some pixelization issues. I've tried editing the settings but haven't been able to fix it. Here is the code:
// set the parallax manager's target object
T2DSceneCamera camera = TorqueObjectDatabase.Instance.FindObject<T2DSceneCamera>("Camera");
ParallaxManager.Instance.ParallaxTarget = camera;
_sceneGraph = camera.SceneGraph as T2DSceneGraph;
// create game gui
GUIStyle playStyle = new GUIStyle();
GUISceneview play = new GUISceneview();
play.Name = "PlayScreen";
play.Style = playStyle;
play.Camera = camera;
BloomPostProcessor bloom = new BloomPostProcessor();
play.PostProcessor = bloom;
bloom.Setup(20, 20);
bloom.ExtractMaterial.BloomThreshold = 0.5f;
bloom.BlurMaterial.IsTranslucent = true;
bloom.BlurMaterial.Size = new Vector2(1.0f, 1.0f);
bloom.BlurMaterial.BlurAmount = 5.0f;
bloom.CombineMaterial.BaseIntensity = .9f;
bloom.CombineMaterial.BloomIntensity = 1.5f;
bloom.CombineMaterial.BaseSaturation = .9f;
bloom.CombineMaterial.BloomSaturation = 1.0f;
bloom.Cleanup();
GUICanvas.Instance.SetContentControl(play);
PlatformerDemoGUI.Instance.GUI.Folder = GUICanvas.Instance;
Any help would be appreciated. Thanks
08/04/2010 (7:21 am)
I'm trying to add this bloom effect to my 2d Torque X Platformer based on the platformer kit and I'm running into trouble.I've got the bloom effect working, but it's causing some pixelization issues. I've tried editing the settings but haven't been able to fix it. Here is the code:
// set the parallax manager's target object
T2DSceneCamera camera = TorqueObjectDatabase.Instance.FindObject<T2DSceneCamera>("Camera");
ParallaxManager.Instance.ParallaxTarget = camera;
_sceneGraph = camera.SceneGraph as T2DSceneGraph;
// create game gui
GUIStyle playStyle = new GUIStyle();
GUISceneview play = new GUISceneview();
play.Name = "PlayScreen";
play.Style = playStyle;
play.Camera = camera;
BloomPostProcessor bloom = new BloomPostProcessor();
play.PostProcessor = bloom;
bloom.Setup(20, 20);
bloom.ExtractMaterial.BloomThreshold = 0.5f;
bloom.BlurMaterial.IsTranslucent = true;
bloom.BlurMaterial.Size = new Vector2(1.0f, 1.0f);
bloom.BlurMaterial.BlurAmount = 5.0f;
bloom.CombineMaterial.BaseIntensity = .9f;
bloom.CombineMaterial.BloomIntensity = 1.5f;
bloom.CombineMaterial.BaseSaturation = .9f;
bloom.CombineMaterial.BloomSaturation = 1.0f;
bloom.Cleanup();
GUICanvas.Instance.SetContentControl(play);
PlatformerDemoGUI.Instance.GUI.Folder = GUICanvas.Instance;
Any help would be appreciated. Thanks
#4
without bloom:
http://s989.photobucket.com/albums/af17/grantham_a/?action=view¤t=WithoutBloom.jpg
with bloom:
http://s989.photobucket.com/albums/af17/grantham_a/?action=view¤t=WithBloom.jpg
08/04/2010 (7:34 am)
p.s. here are some images to illustrate what I'm talking aboutwithout bloom:
http://s989.photobucket.com/albums/af17/grantham_a/?action=view¤t=WithoutBloom.jpg
with bloom:
http://s989.photobucket.com/albums/af17/grantham_a/?action=view¤t=WithBloom.jpg
Torque Owner Duncan Colvin