Forum Replies Created
-
AuthorPosts
-
But you know what.. at least i got really motivated to learn some Android studio and some Xcode now.
Imagine.. having tools that are STABLE and WORKS every fucking version.
No ifs no explosions no fucking glue and rockets made out of papper.
I tried my best to help and it was ignored.
Im so fucking stressed up now so i cant even talk but i was working on my dream game and everything was so close..
I just know that I need to check that M2 v6 + xcode 9.4.1 and Android Studio 3.1.4 and make sure that it compiles to something that you are allowed to upload to the two shops.
Google sets tye minimum API as of August to 28 I believe and maybe other details have changed as well. Applestor i do now if they demand ios12 now.
I can compile ios11.I updated my ipad to ios 12 and now m2 is locked out bc my working setup does not compile to ios 12. i need new xcode to do that.. and .. ya…
Im on a holiday too you can say.
I would feel so fucking shite to do this towards my users if I were him.
No warning…just let it go.
This does not explain the overall slowdown that showed up somewhere after the June/July build.
I remember picking the June build as my stable Monkey2 for a good reason, but I cannot for the world of me remember why.
I remember though that at that point it felt like M2 became more and more primary an undocumented personal tool for the blitzdev team to develop AR and 3D products to sell.
That’s the sad feeling I got..
Quality check.. zero
It came to my attention that things do not look as good in Mojave because of the fact that Mojave makes all NSView’s layer-backed automatically.
This sometimes make a huge difference, and in most apps they do.
This is also one of the reasons why the older version of Xcode still produces executables that runs as they should on Mojave.
You can unpremultiply before saving. This is a test using the basic pixellformat (RGBA8 which I think that’s Monkey2’s default format).
Sorry if it is a bit more lengthy than it needs to be at the moment.
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124#Import "<std>"#Import "<mojo>"#Import "<sdl2>"#import "<openal>"Using std..Using mojo..Using sdl2..Const w:=800, h:=600Function Main()New AppInstanceNew Myapp(w,h)App.Run()End' improve png sizeClass Myapp Extends WindowField counter:Int = 1Field pixmap:PixmapField image:ImageMethod New( title:String="Myapp",width:Int=w,height:Int=h,flags:WindowFlags=WindowFlags.Resizable )Super.New(title,w,h,flags)App.FileDropped+=Lambda(path:String)Print pathpixmap = pixmap.Load(path,,False)If path.Slice(path.Length-4).ToLower()=".png"counter = counter + 1path = path.Slice(0,path.Length-4) + counter + ".png"Print pathEndif' A manual premultyplying routine.' If you don't wannat use the Premultiply flag in Pixmap.Load or pixmap.PremultiplyAlpha().Local p:=Cast<UInt Ptr>(pixmap.Data)Local w:Int = pixmap.WidthLocal x:Int,y:IntFor y=0 Until hFor x=0 Until w' Read the red, green, blue, and alpha from the pixmapLocal r:UInt = (p[y*w+x] & $ff)Local g:UInt = (p[y*w+x] Shr 8 & $ff)Local b:UInt = (p[y*w+x] Shr 16 & $ff)Local a:UInt = (p[y*w+x] Shr 24 & $ff)' The magicLocal rf:Float = r / 255.0Local gf:Float = g / 255.0Local bf:Float = b / 255.0Local af:Float = a / 255.0rf=rf*af ; gf=gf*af ; bf=bf*af' Now combine everything back into the pixmapr=UInt(rf*255.0)g=UInt(gf*255.0)b=UInt(bf*255.0)a=UInt(af*255.0)Local mixed:UInt = a Shl 24mixed=mixed + (b Shl 16)mixed=mixed + (g Shl 8)mixed=mixed + rp[y*w+x] = mixedNextNext' ----------------------------------------------------------------------------------------------------------------------------image = New Image(pixmap)Local savecanvas := New Canvas(image)Local savepixmap := savecanvas.CopyPixmap(savecanvas.Viewport)' Demultiply before savingp=Cast<UInt Ptr>(savepixmap.Data)w = savepixmap.WidthFor y=0 Until hFor x=0 Until w' Read the red, green, blue, and alpha from the pixmapLocal r:UInt = (p[y*w+x] & $ff)Local g:UInt = (p[y*w+x] Shr 8 & $ff)Local b:UInt = (p[y*w+x] Shr 16 & $ff)Local a:UInt = (p[y*w+x] Shr 24 & $ff)' The magicLocal rf:Float = r / 255.0Local gf:Float = g / 255.0Local bf:Float = b / 255.0Local af:Float = a / 255.0If af>0 Then rf=rf/af ; gf=gf/af ; bf=bf/af' Combine everything into the pixmapr=UInt(rf*255.0)g=UInt(gf*255.0)b=UInt(bf*255.0)a=UInt(af*255.0)Local mixed:UInt = a Shl 24mixed=mixed + (b Shl 16)mixed=mixed + (g Shl 8)mixed=mixed + rp[y*w+x] = mixedNextNextsavepixmap.Save(path+"")EndEndMethod OnRender(canvas:Canvas) OverrideApp.RequestRender()canvas.TextureFilteringEnabled = FalseIf imagecanvas.Color = Color.Bluecanvas.DrawOval(200,200,100,100)canvas.Color = Color.Whitecanvas.DrawImage(image,0,0)canvas.DrawImage(image,100,100)EndifEndEndI guess one should take a vaccation from Monkey2 a month or two because this is depressing and enerving. I eas so happy about havimg a working platform.. BAM
let down
If the GUI relies on GetRenderOutputSize then everyone needs to be enlighted that the api now returns a zero for w and h if you haven’t called SDL_SetWindowSize before (simply use the size of the window and call it with that).
This is just a hunch bc I never dive into m2 code (i pay to not having too) but it sounds like this is what needs to get fixed.
CoreAnimation layer forces vsync there’d no way to shut vsync off now in macos nor in ios as far as I know.
https://github.com/gfx-rs/metal-rs/issues/12
This also explains the bad performance introduced in High sierra / 10.0.2 (10.0.1 was the last time it worked absolutely perfectly
You can read in the discussion why it went bad in the slow additive process towards Metal that Apple did, but i never tried those flags myself and I don’t think many did or even knew about these important changes). Anyways they are over now.
CVDisplayLink timer events is now the same as the old vsync interval
To understand the timer issue look at the Spacechimp banana.
The timer is set to fire 300 times per secand still it tops at 95-105 times per per sec when you enable the timer and disable the vertical refresh.I’m not an expert on sdl2 so I can’t fix Monkey2 alone. I know that you insert a delay of 1 – 10 millisecs or else the OS will insert a delay by itself around that same range. 10 millisecs would mean dividing a second to around a max firing around 95-105 per second.
The rules that needs to be followed seem to be:
You cannot use SDL_peepevents() you need to use the more thread-dangerous SDL_pollEvent() and you never do it using while (SDL_pollEvent(&event) but simply SDL_pollEvent()
Alternatively you use eventWait() in its own thread with an inserted delay of 1-10 msec, and 5msec seems to be the better balanced choice.
I also know that sdl2 creates automatic keydowns with no way of disbling this you have to manually filter them out, It only happens with keydown events.
you do that by checking the member of SDL_keyboardEvent().You should never handle event by event but instrad loop trough events until there is no more of the same kind of event and then you push back the last two onto the queue. This way you get efficient code also when resizing windows etc. These kind of details are important actually.
Im the videoinitilizing thread (which prefferable is also the main thread):
sdl-pumpevents() this gathers all pending input fom devices and places them in the event queue this is done implicitly by Sdl_pollevent and sdl_pushevents().And in a dedicated thread :
sdl_peepevents() and sdl_pushevents() are used to send own events or fake events by simply sending them (i assume timers use these user events).sdl2 always translates window events into Sdl_events and places them in a threadsafe queue.
Nothing on the loads but I check for the 100th time now the whole sourcecode and noticed a missed
Monkey1image.Texture.Flags |= Texture.Flags.FilterMipmapSorry for this !!
I’ll the same goes for images with applied shaders because those seem still crisp, but that’s a later problem if so !
If timing does not matter to you then no problem, (you will only see a strange peep error sometimes while using timers, and if you do something heavy then you will also notice how Monkey2 tries to “catch up” events to a certain frame now and then after missing events in prev frames.
It handles all events perfectly, so that is a big plus but very ireggurly and there are times where timing makes a difference.
For starters the lagging of mouse events will always be one frame * more * than it has to be, not a particular good thing in mouse-ctrled games. The mouse is already one frame late in all languages vs the OS because of double buffering the graphics so having to wait yet another frame IS a big deal.
It is not SDL2s own fault because if you read the mouseposition using direct sdl2 in M2 you can actually see this with your own eyes, so if you want mouse in Monkey2, do not use internal mouse commands, use the sdl2 commands instead.
But of course it is much worse than that, as it will creep into the visuals and the audio in different ways.
I think it is the same reason timers still can not be faster than 90 hz or so. I might be wrong on that one.
No But I develop on macOS and Windows. Both have this and there are zero differences in how they are expressed. I am not sure about Linux. But my guess would be it has it too.
Ya I think you just need to to add 3 lines to graphicsdevice.monkey2
Monkey12345Subtractive = 5 ' line 22Case BlendMode.Subtractive ' around line 606 somewhereglBlendFunc(GL_ZERO,GL_ONE_MINUS_SRC_ALPHA) ' 607If I remember my opengl correctly which I hope I do.
Maybe we should discuss what everyone wants to be added and compare the wishes to what is common over all the platforms and also easy enough to add and just do it.
I know for instance that theres ppl that might want the logic Blendmodes, and of course all the 16 standard ones. But to talk about which ones that ppl find *really* useful could be an interesting discussion.
-
AuthorPosts