Black Dragon is MY Viewer, i decide which feature i want to add and which to remove, i share this Viewer to show the world that user base size is not important, i do rate quality by effort, thought and love put into the project, not some rough estimated numbers. I consider feature requests only if i you can name proper valid reasons i can agree on. It is my (unpaid) time i'm putting into this project, i'm not here to cater to every Joe's desires.

Sunday, November 19, 2017

Black Dragon 64x - Update 2.9.3 "Bit Dragon"

This is really just a quick update to get some of the stockpiled changes out and to clean up some things as well as add a big change i want to get feedback on.

Avatar Render Complexity (ARC) also known as Avatar Render Cost.

I changed it. Punish me Oz senpai, i broke your toy.

No seriously, the final nail in the coffin and the sole reason i finally did it was seeing an avatar with 3.5 million polygons and 2 million vertices having almost half as much ARC as my avatar which i spend a shitton optimizing all over the place, it's safe to say that i know better than this mess of ARC whats better for my framerate (well okay i literally deattached my stuff and measured too.... but... you know...) and i'm pretty certain that this 3.5 million polygon avatar is much worse than me. So how do i go about changing it? The simplest solution available. Punish high polycounts. Punish sculpt usage. Punish all the bad things.

I can write the details if anyone's interested but the gist of it is: More stuff = more ARC. Having a higher base polygon count in most cases means you'll have a higher ARC unless you do some other nasty stuff.

Needless to say i'll be tweaking these values and possibly add an option to switch between these two calculations but for now you'll get my new one, just be warned, numbers will be MUCH higher.

Look at these numbers. LOOK AT THEM. You are bad and you are bad and you too. All of you! Except those green and yellow numbers. I suppose you already knew that most avatars totally ignore ARC hence why they have such huge numbers, both polycounts and ARC... but hey, it actually helps, i'm getting 30 FPS there, which i have never ever before.

Friday, November 10, 2017

The thing about Alpha Masking.

I think it is time to give you an idea how broken Second Life really is.

In the past months after i disabled the Automatic Alpha Masking option in deferred by default a bunch of people messaged me about "strange" rendering issues. Of course i knew exactly immediately what they were talking about and i feel it is getting too tedious to explain this over and over again to each and every person, which is the reason i'm going to write this.

First things first. What is the problem? It is this:

Notice how the cubes form an abstract art like impossible image. Notice how the right most cube is in front of the bottom one while at the same time behind it. Notice how the top cube is behind all of the other cubes whereas it is actually on top of them, the cube is casting a shadow too, you can see it coming through. So what is this? It is called z-fighting, more specifically in this case it is alpha sorting (the issue, not the alpha mode).

The renderer has issues deciding whether a given face is in front or behind another due to them using alpha rendering rather than normal solid rendering. I can't explain to you why this is a thing (regardless of if you use DirectX or OpenGL) but my personal assumption from what i know about rendering is that alphas are not included into the depth map. The depth map is (as you may have seen if you used the depth mode in the snapshot floater) a greyscale image that contains depth information for the renderer to sort objects and do all kinds of neat things. Since alphas are not included in it, the renderer has no solid way of telling which face comes in which order so it has to make guesses and and that's when this alpha sorting issue will happen.

To counter this, there are many many MANY things both the developers and the creators can do, generally the best idea which most games as of today follow is simply avoiding blend alpha as much as possible because and this is the thing, this ONLY happens with alpha blending, not with alpha masking. Alpha masking is a 1 bit alpha channel (either on or off, invisible or not) thus it can be handled like any solid surface without much problem unlike 8 bit alpha which is alpha blending.

So why not make everything alpha masking? Well... see... as much as i would like to, this is the issue. You can't just set everything to alpha masking and BAM everything is fixed, each texture is unique and needs a unique alpha masking cutoff value to go along with it so the renderer knows at how much transparency it should simply use invisible rather than visible. Even worse, some textures simply can't use it because they need the alpha blending such as if you want a color grading overlay or say transparent textures like water or other fluids. In these cases we must use alpha blending.

This will inevitably cause different alphas to clash with each other and cause alpha sorting if looked at from certain angles. Myself as furry i had this issue happen long ago very often. Every single club had a transparent floor, transparent particle clouds for fog and transparent laser lights and such all over and guess what happens if you tail is a flexi alpha blending surface? You guessed right, it's gone. It will be sorted behind all the other stuff... in between... sometimes in front and everything in between that. It's a well known issue and i'm pretty sure you have seen this happen somewhere already.

But this isn't everything, alpha surfaces are not subject to most graphical effects that use depth such as Screen Space Ambient Occlusion (SSAO) and Depth of Field. In the latter case the renderer has to reside to some dirty hack by forcing all alphas internally to solid surfaces (without masking cutoff) and using those into a new depth map with those included, the result is Depth of Field going off on places it shouldn't. Here's an example of this:

Notice how the alpha glow effect is handled as solid surface, blocking and overwriting the depth to go further resulting in depth of field looking kinda broken. The same happens with particles too.

In the case of SSAO, which simply doesn't work on alpha surfaces, you'll have to look closer. It is highly possible that in any other Viewer other than my own you most likely won't notice the absence of SSAO as SSAO is by default extremely weak and almost not distinguishable from the same scene without it. Here's an example with top being alpha, bottom being masked:

Lastly shadows. Shadows from and and on alpha surfaces have all kinds of issues. For once they don't get the soften light pass which means they are pixelated rather than blurred and softened. Shadows cast from alpha surfaces have similar issues, they appear less precise and break faster than solid shadows. See these examples, top being alpha, bottom being masked:

So why all this? What are you trying to tell me Niran? I know what alpha sorting is and if i didn't i now know about it, what's the deal? The deal is many many textures in Second Life contain an alpha channel when they shouldn't which will flag any surface you use them on as alpha blending automatically which will cause all of the above mentioned issues. What's worse, Linden Labs made a feature called Automatic Alpha Masking (Deferred) and Automatic Alpha Masking (Non Deferred) for deferred (advanced lighting model) and without it respectively, these options are a hack employed before Materials was introduced, which gives us the ability to control whether we want to use masking or blending for alphas. The issue with these hacks is that they are just that, dirty hacks from pre-Materials times that are still in effect by default, they do a piss poor job at actually masking surfaces they are applied to and they hide the fact that your texture has an alpha channel and a whole host of graphical issues coming with it. To elaborate: Automatic Alpha Masking does stop quite a few surfaces from doing the alpha sorting, given they are solid textures but with an alpha channel included (which shouldn't be included), thus stopping the alpha sorting issue to appear on them but.. this only goes for simple objects and surfaces. Enter meshes. Shadows are still pixelated, SSAO doesn't work on it, lighting is off and so on. Here is an example comparison between Automatic Alpha Masking (top) and manual masking (bottom) on meshes:

Notice how the purple light on the left doesn't have any impact on the automatic one but clearly shows up as it is supposed to on the manually masked one. Notice how shadows are soft. Notice how the entire body looks much more part of the world, i dare to say "more realistic". This is with the hack enabled, yet its still broken.

So what to do about it now? First you have to ask yourself 2 questions. Can i edit the texture? If yes, do it. Remove the alpha channel if its not needed, this is always the number one priority fix. Fixing the texture means less resources wasted for you and everyone else as well as having the issue fixed once and for all. You can do this in GIMP by selecting the "Layers" menu at the top and going down to the "Transparency" sub menu, in it you'll find the option to remove the alpha channel. Optionally you can save the texture as JPEG if you are really unsure. JPEG doesn't know alpha and don't worry, SL converts all textures to a trash JPEG format anyway, no loss compared to PNG upload. If you can't edit the texture, ask the second question, can i edit the object? If so, select the prim or the single surface you want to change, go into edit mode (right click - edit) and select the "Texture" tab. Here you should find a dropdown menu that will be reading "Alpha Blending" by default, click it and change it to "None" if you are absolutely not using the alpha channel for anything.

Select "Alpha Masking" if you need alpha to cut off body parts or holes into said body parts for instance, then change the Mask Cutoff to a value that compliments the texture and makes it look good, usually something around 70-80 is a good value. I did so with my hair and it looks much better.

Textures that are made to be used for Alpha Masking obviously look even better. If you make textures always try to avoid using blending as much as possible, try to design your textures around masking. A great example of great masking usage is this Skadi Sergal:

Notice how it uses masking for the tail fluff, arm fluff, leg fluff, mane, ear fluff, chest fluff and pretty much any sort of details that resemble hair and it looks cute and fancy.

Because all these things are so horribly broken and Automatic Alpha Masking being the only thing that tries to hide it from the user i decided to disable Automatic Alpha Masking and show you the world as it really is. Broken.

But why are you doing this Niran? Why would you do this when all Viewers aren't doing it? Because i believe that hiding the issue won't help us fix it. Other Viewers are simply pussies, they fear backlash from their users, they don't have the willpower and energy to put up with you and explain to you what the issue is and how to fix it because they see you as completely retarded, on top of that, i've met quite a few extremely ignorant people who simply brush it off as Viewer bug and "not their cup of tea". Guess what, they are horribly wrong. It IS their cup of tea, THEY fucked up in their texture and it is THEIR responsibility to fix it. Only few will however and this is why i'm telling you so you can fix it yourself... if you got modding rights. I don't care if you complain at me that messy alpha is messy. I'll tell you that alpha is messy and that there are better ways to fix it than enabling a hack which merely fixes the sorting issue half of the time.

But hold on Niran... what about those poor people who bought no mod stuff? They can't just edit the mesh/object. Well... while that is correct all i can say is. Complain. Complain complain complain, not at me of course, at the creator who dares to sell you broken no mod stuff and if they want to get rid of you by finding excuses why not to allow mod permissions, send them to me, i'll give them a lecture when and where to use .... not use mod permissions. They will either listen or be ignorant, in the latter case you should stop buying their stuff and you should tell anyone and everyone to do the same, bad content creators are one thing, ignorant, improvement resistant creators are a whole nother thing. Don't support them. Instead you could buy one of those nice avatars for which you probably pay less. Support creators who put real effort into their products, who create good content, who are interested in improving Second Life with meaningful content, not some quick cash grab garbage.

To end this post, i've recently helped someone fix their Kemono and boy i was in for some fun, i ended up going through each and every face, making it invisible to see what it is, then set it to masking if its solid and blending if its an overlay. This cost me half an hour. I hate to say it but if you can't do it, i'm willing to help you and do it for you. Here are comparison pictures of before (top) and after (bottom):

Oh right. If you absolutely have to because there is absolutely no way around it. You can re-enable the Automatic Alpha Masking hack by going into Dragon - Develop - Rendering - Automatic Alpha Masking (deferred) and/or (non-deferred). I don't recommend doing it unless absolutely necessary, you'll be lying to yourself! Pink Glasses! Pink Glasses!

Got any questions? Did i miss anything? Tell me, i'd gladly like to know how to improve this ugly mess of a wall of a text.

Black Dragon 64x - Update 2.9.2 "Bit Dragon"

This update focuses on getting the Viewer up to date with the latest maintenance changes from Viewer Bear.

This includes the inclusion of a worn tab in inventory as well as a dropdown to select a search filter type, meaning you can now search for UUIDs, Names, Creators and Descriptions. The filter window for the inventory has gotten a "created by me" and "created by others" option too allowing you to further limit your search. While adding these i thought it would be the perfect time of overhauling the filter window layout too.

And since i can't stop molesting the UI when i started i also took the time to improve the object weights window and added a triangle count display to it.

The total triangle count of each avatar can now also be seen in the avatar complexity tag and to my shock... the Viewer is rendering much much more triangles than i thought in any given scene.

These pictures also make one big problem very apparent, the utter fail that is the avatar render complexity calculation. If you look at the above second example you'll see someone with three and a half million triangles (polygons) in the right  lower corner, how this person can achieve roughly half of my ARC even with my enormous amounts of optimization both on the texture part and the avatar part is a complete mystery. No avatar with 23 times as much polygons as me should have half as much ARC as me just because i use a few lights and some flexi stuff. THIS is the very reason why you see all these shit onion layered meshes but can't see your buddy because he uses a few flexi parts. This has to stop. I'm going to touch the ARC calculations with the next update.

Then there's also the addition of the several times requested FPS throttle feature, with the Viewer Bear merge it is no a thing, you can find the option in Preferences - Display as usual.

I also cleaned up some code, added the ability to fullbright and change alpha masking locally, although they only change after deselecting and masking currently only works if a face has had a mask cutoff set at least once at some point. I'll be working on the last part, can't promise anything about the first. This should be helpful to locally fix people's faces, eyes, body and so on for a picture for instance, or simply for showing them how it would look if it wasn't broken (man i could have used this so often by now...)

Also thanks to DracO HirudO, Ken Durham, Akritos Rain and Dhalgren Correia for supporting me!

The update is in the making already, sorry for taking so long with this post.

Saturday, November 4, 2017

Black Dragon 64x - Update 2.9.1 "Bit Dragon"


So 2 weeks later and i've been nothing but circlejerking in the Viewer trying to get something done.

Sometimes you're just working for days on something and it just wont work so you seem like making 0 progress and its kinda saddening as it delays the entire update... but ohwell here we are. I got it under control.

Today i some fancy changes for you, starting off with the new screen space reflections look, you'll find it to be a bit faster and generally better looking, have a look:


Then there's the interface overhaul, specifically the inventory and people windows. Inventory has been one of my biggest annoyances, it's one of the most used windows in the Viewer and it just looks like someone quickly threw it together, i wanted to fix that and make a new consistent layout for all sidebar-like windows, this includes the people window and later the other ones like places, picks, groups and so on. For now it's just inventory and people, both have a menu at the top right, both show info related to it at the top left and both have just one single bottom button bar now, everything looks neatly organized now. Finally. I made the groups list a bit less crappy looking too while i was at it.

New and never before seen is the ability to preview .anim animation files directly inworld on your avatar with the Pose/Animation Manipulation window. Simply open it and hit "Create", select an .anim animation file and it will be loaded and temporarily created for you to be used. Simply select yourself and hit "Apply To" to play the animation on yourself and preview it. AWESOME.

I also made it possible to put calling cards into the top favorite bar. Currently doesn't have any special functionality besides dragging it in and showing the profile on click. I want to extend it to allow more inventory object types such as objects and MAYBE even folders for favorite outfits. I also want to change calling cards to request a teleport if the person is in your friend list and automatically track and initiate a teleport to said person if you got their map rights, just like you'd do via the map but without having to actually open it and use that stupid dropdown, favoritising your favorite friends, yay! Totally made that word up.

Now comes the bad part. Still no launcher. I decided to bite the bullet here and continue naming the versions like i previously did as it makes no sense delaying the "update versioning" because the launcher is not working, i'd end up with a gazillion betas and gammas and alphas and release candidates. Screw that we'll resume the normal versions. Right now it appears like the launcher is fully incompatible with third party viewers so you'll have to update manually when i force an update... which... is the next bad news.

I noticed that Alex Ivy (64bit) changed the way the channels are displayed, i don't know if this has any impact on the update channels so when i force an update nothing might happen... that or the Viewer will be completely locked out... in the worst case that is. There's sadly only one way to find out, so bear with me here when i start forcing this update. If shit hits the fan i'll try to get this fixed as fast as possible.

Last bad news for today. No merge with latest Linden Viewer code because... i delayed this update for 2 weeks which is already way too long and i felt like i should show some actual progress and i wanted to show a fully working Viewer before making any big changes again. I know for sure that when i merge the latest code something will break again and i'll most likely notice it 6 years later down the line, like i did with a few other things... also making smaller incremental updates makes it a lot easier to find out on which version a specific issue started happening, making it easier for me to find the specific change that caused it and thus making it easier to fix said issue.

I'd like to say that the Patreon thing has received some really positive feedback so far, and quite some people have already started supporting me via Patreon.

Thank you very much

Kei Kurono
Maddy Gynoid
Richard Call
Ulrike Woltering
Viki Tran
William Betteridge

Enough talk for today, enjoy 3 fancy pictures i made with the Poser and another fancy random one showing the new SSR.