Increase visual quality in Fan-Ages !

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.

Increase visual quality in Fan-Ages !

Postby Sirius » Thu Jan 15, 2015 6:56 am

Hi everyone,

As some of you may know, one of my major complaints with Fan-Ages, is that they graphically don't look half as good as Cyan's Ages. That's to be expected, since fans may not know or may not want to bother with increasing visual quality in their Ages. I'm not criticizing, I fully understand how much work it is, especially on Plasma and with the current tools.
The problem is, it's these Ages that are often the most interesting to visit because of their size and the number of things to do in them. For instance: Elodea isn't top-notch when it comes to visual quality, however it's still one of the most populars currently.
And it's quite a shame: size is often incompatible with beauty, while maybe we could do something about it.

What I had in mind was to automate some things for Age authors.

In the case of light, currently the authors have to setup light sources, manually select each object, and bake the light, before exporting. However, because of a single modification in a mesh, they may have to rebuild light for their whole scene... And when we're talking about lightmaps, the setup for a scene is completely different from the export setup. In the best case, you have one light setup for baking, and another for exporting (as in Relativity).

Now, because of how Plasma/Blender/PyPRP work, it's impossible to have the scene be automatically baked and exported, as engines like Source or Unreal do. Plus, you can't enhance an Age yourself if you don't have the Blender file.
As for letting Plasma do the lighting... Well the result is often a disaster, performance-heavy, and you don't even have features like shadows (well, it exists, but they are so not realistic and performance-heavy that you can only use them for avatars).


However, since doing things in Blender is not the easiest solution, I thought it could be cool if we could edit the Age after it's exported. Say, press a big, friendly button named "Make Age Better", that automatically builds light, without requiring to know anything about how light baking works.

I therefore wrote a basic lighting system, to bake light for Elodea... and Dulcamara kindly accepted that I share comparisons pictures with you !
Elodea was a good choice - it features a very interesting terrain with plains, mountains, beaches, caves, etc, which are really worth enhancing !
You will notice I made the distant fog blue, which looks even better.


Show Spoiler



In these screenshots, I used an algorithm of mine to bake light of a single sun onto the vertices' color layer --which is fortunately not used by most Age authors-- resulting in more realistic light, with absolutely no performance cost, and no additional memory required.

Since it would not look good in caves, and would be completely useless in Ages with no sun at all, I then wrote another algorithm to bake ambient occlusion. The result was surprisingly good for an algorithm I made up myself. Although baking for Elodea came up from a minute to two hours ! Heh, it may be accurate, but it's slow. I'm not an expert when it comes to mathematics and optimisation after all :P

Well, here is how it looks with AO:

Show Spoiler


With this, Elodea is even more interesting than it originally was, in my opinion. Tweaking the mist helped a lot. I also fixed the physics so they are no longer bumpy (a real relief), tweaked the engine to render in 16/9, and even fixed the sky animation so it doesn't reset each minute.
Writing the program itself was not too long either - a few hours of work in total.



So, what do you all think ? I will probably release the tool sometime, although for now I'd like to improve the interface and make things like sun/AO intensity customizable. Maybe add shadows cast by big objects such as mountains. Oh, and make AO baking a bit faster too. Meanwhile, I would be quite interested in knowing what you think about it.
User avatar
Sirius
 
Posts: 1147
Joined: Mon Jul 26, 2010 4:46 am
Location: France

Re: Increase visual quality in Fan-Ages !

Postby janaba » Thu Jan 15, 2015 8:08 am

It is great, Sirius, that you have chosen Elodea for your experiments, and it is also a wonderful compliment for Dulcamara that you did this, you as knowledgeable creative perfectionist ... :P

While I don't like the faint look of the distant ocean and trees, I am really impressed and it is absolutely astounding what you have achieved with your tweaks here and there and what a great difference it makes ... Thanks for providing so many exemplary before and after pictures ... Everything else, besides the distant stuff, which can be adjusted separately I suppose, looks astoundingly more realistic and smoothed out etc., just wow, and if that'd be possible, as you say, 'with absolutely no performance cost, and no additional memory required' and even on that scale of Elodea, here comes another wow lol ... 8-)

Besides that, it is of course awesome and a great service to the age builder community to have those handy tools you have created resp. are about to compile and release, because as you've said

'However, since doing things in Blender is not the easiest solution, I thought it could be cool if we could edit the Age after it's exported. Say, press a big, friendly button named "Make Age Better", that automatically builds light, without requiring to know anything about how light baking works' ..... 'I will probably release the tool sometime, although for now I'd like to improve the interface and make things like sun/AO intensity customizable. Maybe add shadows cast by big objects such as mountains. Oh, and make AO baking a bit faster too' ...

like that for example and other solutions for improvements on a grand scale as you've mentioned in your last paragraphs ... What a wonderful job and idea, Sirius ... :)
Image
User avatar
janaba
 
Posts: 918
Joined: Sun Feb 05, 2012 3:27 pm
Location: Berlin, Germany

Re: Increase visual quality in Fan-Ages !

Postby Tweek » Thu Jan 15, 2015 8:16 am

I welcome anything that brings better lighting to fan Ages.

It does seem like a lot of builders just drop a sun into their build and go "well...Age lit" and as a result there are a lot of bright..bright flat looking Ages. Most of the changes you've made to Elodea could have been likely solved with vertex painting and light maps and some tinkering with the FNI files. I do agree however that lighting in Uru is such a pain in the neck, having a easier way to do it with more options would be nice.
Beneath - IC Blog.
Beneath: Ages of Tweek - FB Age Dev Page.
User avatar
Tweek
 
Posts: 683
Joined: Sat Sep 29, 2007 6:37 am

Re: Increase visual quality in Fan-Ages !

Postby Deledrius » Thu Jan 15, 2015 8:57 am

Nice work, Sirius! This is a very useful tool to have.

How do you currently select the sun's location? Are you keying it to a dummy object's CoordinateInterface?
User avatar
Deledrius
Gehn Shard Admin
 
Posts: 1253
Joined: Mon Oct 01, 2007 1:21 pm

Re: Increase visual quality in Fan-Ages !

Postby Christian Walther » Fri Jan 16, 2015 3:58 am

Yess! 8-) Great work, Sirius! That flat look (exemplified in elodea_7bis) is so disorienting and takes so much of the fun out of exploring otherwise excellent ages. Much better after your intervention, amazing what an automated tool can do (even though it could of course do better with more manual input from the artist).

I notice some odd shadows in some relatively flat places, best seen on the sandy plane at the right of elodea_7, do you have an explanation for those?

It does emphasize the lack of sharp edges, e.g. on the roof of the chapel in elodea_8 – my other pet peeve with many fan ages made by people who are unfamiliar with the technical details of how polygon mesh rendering works (what vertex normals are).

The fog adds a lot of believability as well.
Christian Walther
 
Posts: 435
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Re: Increase visual quality in Fan-Ages !

Postby Sirius » Fri Jan 16, 2015 9:42 am

Janaba wrote:While I don't like the faint look of the distant ocean and trees [...] which can be adjusted separately I suppose
Yes, I manually edited the mist, it's not part of the tool... BTW, there is already mist in Elodea, but it's black, which makes it harder to notice (and doesn't fit an outdoor scene anyway). I didn't change the thickness, just the color.
However it's actually pretty simple to make it thinner or remove it altogether. I guess I could add an option for it in the program's interface.

Janaba wrote:you as knowledgeable creative perfectionist ... :P [...] What a wonderful job and idea, Sirius ...
:D Thank you very much for these kind words, Janaba !


Tweek wrote:It does seem like a lot of builders just drop a sun into their build and go "well...Age lit"
Well, even if there is a sun in the Age, most authors make all their materials shadeless, so basically the sun lights up the avatar, but nothing else...
Actually, what I did is not really far from that: the only other light source besides the sun is ambient light, which makes sure all objects get a bit of light regardless of whether they are facing the sun or not (otherwise, they would be pitch-black).
Then, there is AO, but it's hardly noticeable outdoors.


Tweek wrote:Most of the changes you've made to Elodea could have been likely solved with vertex painting and light maps and some tinkering with the FNI files
It is indeed vertex painting, it's just generated outside of Blender. It doesn't even add a single lightmap :P (that's hardly feasible outside of Blender anyway).

Blender still offers much more possibilities in terms of lighting, but this method is waayyy faster.
The only two issue are it doesn't add point lights where objects like torches are (which could enhance interior scenes drastically), and it assumes every object to be an opaque visual (water is automatically excluded since it's not directly affected by vertex painting, but objects like sky or plants must be specified so they aren't modified - obviously, we don't want a shaded skydome).


Deledrius wrote:How do you currently select the sun's location? Are you keying it to a dummy object's CoordinateInterface?
That would be an idea, but no. I was designing it to work without having the original Blender file, so the sun's orientation is not tied to any object. Light direction is entered as a 3D vector, colors for the sun and ambient light are given using RGB values. And right now, it's still hardcoded into the program, since there isn't a user-friendly interface anyway.


Christian Walther wrote:I notice some odd shadows in some relatively flat places, best seen on the sandy plane at the right of elodea_7, do you have an explanation for those?
Wow, I didn't think someone would pay much attention to this ! Yes, it's a bit too strong for a few reasons.
  • vertex painting is obviously quite inaccurate when the faces are too huge, which is often the case with terrain
  • the sun is quite low on the horizon, and this area is quite bumpy, so it has a lot of shadowing.
  • pictures in the first spoiler tags were taken with the first version of my algorithm, in which I forgot a small step in computing. If you want the details, I'm using the angle between the vertex' normal vector and the sun direction as a factor for sunlight intensity (at 180deg it's 1, at 90° and below it's zero). I was using angle=(vnorm DOT sundir), both vectors normalized. However I forgot this only gives cos(angle), while the correct formula was angle=acos(vnorm DOT sundir)... which means the transition from light to dark was less smooth that it should be.
It still results in heavy shadowing in some places, but this time I think it's due to vertex painting. Still, I didn't think it would show in pictures !

And, of course, AO doesn't perform well in some places either. Windows, hanging moss or a little vegetation is enough to darken a whole place, since I don't take transparency into account.

As for smooth edges on meshes which should look sharp: I guess this falls into the "more manual input from the artist" category. Checking the angle between faces and duplicating vertices when needed would be great, but it's a bit more complex to do, doesn't perform well on all meshes, and adds processing time :( I'll wait a bit before adding it.




I optimized the AO algorithm today, and managed to get Elodea baking in just 8 minutes, instead of 2 hours :shock: Turns out the acos() function is a LOT slower than I thought (that, or dividing by PI afterwards... I dont know which is the slowest, but I think that's acos), and getting rid of it helped a lot. I also grouped faces in bounding boxes, which helps a bit. I might get even better results by avoiding the square root function.

However, getting rid of acos causes the previous issue with sunlight, and makes AO a LOT stronger and less smooth than it should be.
User avatar
Sirius
 
Posts: 1147
Joined: Mon Jul 26, 2010 4:46 am
Location: France

Re: Increase visual quality in Fan-Ages !

Postby Annabelle » Sun Jan 18, 2015 10:05 am

That's awesome Sirius!

If you say you are working with Dulcamara, does this means we will see your improvements inside her ages, a new Elodea sort of?

It would be great if the writers would adopt your tool to improve the overall quality of the fan ages.

And inside the 2nd spoiler of the 1st post, you wrote this:

Sirius wrote:Oh, and the spherical thing near it is a marker - the original low-res texture was making me feel sad.


What do you mean? I never saw such a thing in that room neither near the lower balcony where you have another one smaller.
Annabelle ;)
User avatar
Annabelle
 
Posts: 791
Joined: Sun Aug 29, 2010 1:47 pm

Re: Increase visual quality in Fan-Ages !

Postby Sirius » Sun Jan 18, 2015 11:25 am

Annabelle wrote:If you say you are working with Dulcamara, does this means we will see your improvements inside her ages, a new Elodea sort of?
Well, why not, as long as Dulcamara is okay with it.
Either way, when it's released, anyone will be able to run it on any Age, as long as it's for offline use. It will be up to the authors to decide whether to use it for their UAM/Deep Island release.

And right now, this only includes the overworld. I tried using the program on the Unterwelt, but it wasn't doing any good - actually, it almost made things worse. I was using ambient occlusion only (which is used to darken small caves & corridors), but with the fast version, the loss of accuracy is clearly visible... There is another issue: Unterwelt is a huge cave, so the scenery doesn't benefit a lot from ambient occlusion (meaning when looking from a balcony, all buildings have almost the same color/light as usual). Additionally, vertex painting doesn't look so good on flat walls and corridors.


[mumbling to self]
Hmmm... Actually, this part of the Age would benefit more from hand-placed light sources (for instance, near the street light, windows, or inside rooms). That's a bit of an issue, since you'd need to re-import the Age in Blender for this (importing the Age in Blender to only re-export lights ? That's a bit awkward).


[still mumbling to self]
Ideally, we would make a Blender plugin (or upgrade PyPRP) to automatically duplicate the scene, calculate the light, and make objects ready for export through PyPRP.
Pros: 10000x better quality because of lightmaps. WYSIWYG Blender render.
Cons: must have the original Blender file. Insane coding, very long computing time on export, etc. And outdated when Korman comes out.


Annabelle wrote:What do you mean? I never saw such a thing in that room neither near the lower balcony where you have another one smaller
I mean, it's a KI marker, the ones you use in marker missions ! (which often end up in unreachable places in your marker quests, Annabelle :lol: ) I like to place markers in an Age I'm exploring to avoid losing my way.
Since the default texture is very pixellated, I replaced it with the first circular texture I found on the Internet.
I just wish markers were replaced by eggs during Easter. THAT would be fun to collect !
User avatar
Sirius
 
Posts: 1147
Joined: Mon Jul 26, 2010 4:46 am
Location: France

Re: Increase visual quality in Fan-Ages !

Postby Annabelle » Sun Jan 18, 2015 1:39 pm

Ah oui... :lol:

Those markers are not "that" unreachable... at least for me ;)

Seeing them on your pictures, one thing for sure we cannot miss them, they are huge.

And for the tool, if I get it, it works under certain conditions which are mainly met by an age with outdoor sceneries and a sun than a indoor age like Unterwelt or Tunnelgang or Schatzkammern. At least if Dulcamara uses it on her mainland it would be a great "vitrine" (showcase) for her worlds (Elodea, Alabaster, & Gallardien).
Annabelle ;)
User avatar
Annabelle
 
Posts: 791
Joined: Sun Aug 29, 2010 1:47 pm

Re: Increase visual quality in Fan-Ages !

Postby tachzusamm » Tue Jan 20, 2015 7:26 am

This is gorgeous, Sirius. I'm impressed, really impressed.

As a person who has used lighting, lightmaps and vertex painting to the extreme, I know what proper lighting can add to an Age. Unfortunately this takes about 90% of work on an Age.
But I would never have expected that it's possible to add vertex painting AFTER the Age has been exported. This is so surprising, and it's really good work, dear friend.

This adds so much to the depth of Elodea, the visual impact. You can suddenly see the structure of objects on those screenshots; before that, is was only possible to determine if this or that is flat, rounded or limited in shape by walking around those rocks - or using extreme imagination.

Well done.
User avatar
tachzusamm
 
Posts: 575
Joined: Thu May 29, 2008 2:03 am
Location: Germany

Next

Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron