About Monkey 2 › Forums › Monkey 2 Programming Help › Proper RGBA32F fbo support in deferred rendering
This topic contains 4 replies, has 2 voices, and was last updated by 
 Mark Sibly
 1 year, 9 months ago.
- 
		AuthorPosts
 - 
		
			
				
July 12, 2017 at 7:21 pm #9281
I notice that despite the Mojo3D deferred renderer requesting an rgba32f texture, Mojo actually only provides 8bit rgba textures.
This means dark colours are losing precision, due to the gamma adjustments (for linear lighting)Here’s a simple gradient:

And here’s how it looks in the deferred renderer:

See how poopy it is?
And that’s without any light sources and the EnvTexture being a 1×1 black texture.Is there an eta. on when we can expect rgba32f support so that linearspace lighting doesn’t ruin the darks?
xoxo Eternally yours, Hezkore
July 12, 2017 at 7:23 pm #9282Here’s the code if anyone wants to give it a go themselves.
The “test.png” file is in the first post.Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748Namespace myapp#Import "<std>"#Import "<mojo>"#Import "<mojo3d>"#Import "assets/"Using std..Using mojo..Using mojo3d..Class MyWindow Extends WindowField _scene:SceneField _camera:CameraField _ground:ModelMethod New( title:String="Simple mojo app",width:Int=640,height:Int=480,flags:WindowFlags=WindowFlags.Resizable)Super.New( title,width,height,flags )_scene=Scene.GetCurrent()Local pixmap:=New Pixmap(4,3 )pixmap.Clear( Color.Black )Scene.GetCurrent().EnvTexture=New Texture( pixmap,TextureFlags.Cubemap )_camera=New Camera_camera.Near=.1_camera.Far=100_camera.Move(0,55,0)_camera.RotateX(Pi/2)Local mat:=New PbrMaterial(Color.Black,0,1)mat.EmissiveFactor=Color.Whitemat.EmissiveTexture=Texture.Load("asset::textures/test.png",TextureFlags.WrapST)_ground=Model.CreateBox(New Boxf(-50,-1,-50,50,0,50),1,1,1,mat)EndMethod OnRender( canvas:Canvas ) OverrideRequestRender()_scene.Render( canvas,_camera )EndEndFunction Main()New AppInstanceNew MyWindowApp.Run()EndJuly 12, 2017 at 8:48 pm #9284July 12, 2017 at 8:56 pm #9285Thanks.
Why is PixelFormat.RGBA32F not default.. infact you’ve commented that out.
Is it for backwards compatibility or something?UPDATE: Looks like it’s been changed in newer Mojo3D, it was just my old version
July 12, 2017 at 10:50 pm #9286Not sure what the default will be yet. Float textures are strictly speaking an extension under GLES2.0 so I initially just wanted to play it safe.
 - 
		AuthorPosts
 
You must be logged in to reply to this topic.