About Monkey 2 › Forums › Monkey 2 Development › Glitchy 3D
This topic contains 9 replies, has 7 voices, and was last updated by
aleana 1 year, 2 months ago.
-
AuthorPosts
-
December 27, 2017 at 1:12 pm #12459
Using latest Monkey 2 I’m getting some weird 3D glitches when rendering simple stuff without any 2D.

That torus is supposed to be black.
However, if I draw some text on the canvas; everything seems fine.Here’s the code.
Uncomment line 43 (‘canvas.DrawText’) to see it “fixed”:Monkey12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152#Import "<std>"#Import "<mojo>"#Import "<mojo3d>"Using std..Using mojo..Using mojo3d..Class MyWindow Extends WindowField _scene:SceneField _camera:CameraField _light:LightField _donut:ModelMethod New( title:String="Simple mojo3d app",width:Int=640,height:Int=480,flags:WindowFlags=WindowFlags.Resizable )Super.New( title,width,height,flags )_scene=Scene.GetCurrent()_scene.ClearColor=Color.Black_camera=New Camera_camera.Near=.1_camera.Far=100_camera.Move( 0,0,-3.5 )_light=New Light_light.RotateX( 90 )Local material:=New PbrMaterial( Color.Black )material.EmissiveFactor=New Color( 0,2,0 )_donut=Model.CreateTorus( 2,.5,48,24,material )EndMethod OnRender( canvas:Canvas ) OverrideRequestRender()_donut.Rotate( .2,.4,.6 )_scene.Update()_scene.Render( canvas,_camera )'canvas.DrawText( "Width="+Width+", Height="+Height+", FPS="+App.FPS,0,0 )EndEndFunction Main()New AppInstanceNew MyWindowApp.Run()EndOh, and I’ve noticed that 3D now ‘stretches’ when you resize the window.
It used to adjust itself to the window size.
Why the change?December 28, 2017 at 3:12 am #12472The torus is bright green here, same as the solid part of your gif animation, regardless of the commented/uncommented line.
You say it’s meant to be black, but doesn’t the emmissive factor change that? I notice the middle ‘green’ parameter is 2, but isn’t that a 0.0 – 1.0 float? Not sure what emmissive factor does, but ‘sounds’ like it should make it glow in the colour given, so looks right to me!
Guessing that corruption is driver-specific since it’s rendering OK here… what’s it running on? Perhaps that Color (0,2,0) is causing some oddness with your driver, whereas mine is capping it at 1.0?
December 28, 2017 at 3:26 am #12473Oh sorry, yeah.. didn’t notice that little EmissiveFactor call.
This is actually part of the Ted2Go “Simple Mojo3d app” template, so that EmissiveFactor wasn’t something I added.But either way, I’m still getting glitchy stuff without the EmissiveFactor color.

I’ve tested this on a few GPUs I have here, they’re all Ati cards though.
But all running a few different versions of the Ati drivers.
The above GIF was recorded on a Radeon RX 460 with the latest drivers.Here’s the same thing, but with some 2D canvas calls.
December 28, 2017 at 3:44 am #12474Weird, it’s like some buffer isn’t being cleared… or a different buffer format to what’s expected… or something…
December 28, 2017 at 4:10 am #12480On my MacBook Air all I get is the green shadow with or without the text.
December 30, 2017 at 7:31 pm #12530All working fine here although very green…should have a slightly better template for mojo3d in there…
I have an nvidia gfx card though. Can anyone confirm this happens on nvidia too, or is it ATI only?
Can someone try canvas.Flush() and/or opengl.glFlush() before/after _scene.Render()?
Reszie behavior is the same here on both develop and 1.1.08 releases, but this is all getting messed with at the moment so don’t worry about it (yet).
January 5, 2018 at 8:17 pm #12680Works fine on my GTX 1050, GTX1070 and Quadro FX 1800 cards (Windows 10, Windows 10 and Windows 7)
January 7, 2018 at 4:28 am #12721I get a black background and a super bright green non shaded torus.
GPU : Radeon Pro 580 8 GB
January 14, 2018 at 5:43 pm #12862@Mark Sibly the artifact are still there after using canvas.Flush() and/or opengl.glFlush()
January 19, 2018 at 12:53 pm #13032I’m not sure if it matters, but, my laptop with a 940MX (Nvidia) shows no glitchiness, with or without the 2D call. Maybe it’s a driver issue? A GL issue? I just don’t have the resources to investigate this.
Best wishes everyone.
-
AuthorPosts
You must be logged in to reply to this topic.