Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Wed Oct 23, 2019 2:56 am

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Wed Aug 26, 2009 10:22 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
I've finally tried to implement Valve's "Improved Alpha-Tested Magnification", like shown on this paper :
http://www.valvesoftware.com/publicatio ... cation.pdf

It requires very few changes to Raydim (a new blend mode), but the hard part was to write the texture generator.

Here's the current results:

Rendering with a 4096x1024 texture (sample picture):
Image

Now using a rescaled texture, 128x32:
Image
Ugly, of course :)

The same 128x32, but with an alpha test of 0.5 (if alpha is lower than 0.5, pixel is not drawn, if upper, drawn at full opacity):
Image
Much nicer, but we can the artifacts caused by bilinear filtering.

Now using the generated "ATM" 128x32 texture, created from the 4096x1024 texture:
Image
Edges are a bit softer than the hi-res texture, the result is aliased a bit, but it's quite impressive for a texture with a thousand times less information ! And it costs almost nothing at rendering time.

Drawbacks are:
- seems to work only for "flat" textures (8 bits only)
- anti aliasing is not possible without shaders (or FSAA of course)
- seems useless with highly detailed images (font2)
- bilinear filtering only ?
- idea is quite complex to understand, so we add this feature to the engine, we must also add documentation. If we add doc for this feature, we must also add documentation for HDR, BOX, ENV, ... and other prefix, since I currently use a new "ATM" prefix for such textures. It's not very hard to do, but ... :)

... so at the end, it's seems that it's a technically impressive feature, but I've no idea what we can do with it ! :)
Do you think there's something interesting here ? Should I push researches a bit ? Should I commit ? Post a patch ? ...


Top
 Profile  
 
PostPosted: Sat Aug 29, 2009 11:41 am 
Offline

Joined: Tue Jul 08, 2008 2:37 am
Posts: 181
Looks interesting! :shock:

First I thought about sharper Raydium fonts, but you've written about font2, which is useless there, because it's already highly detailed.

What about bitmap/pixel fonts? I remember that I've tried to create a "blocky" looking font, but it wasn't possible because the characters will be looking very washy in different resolutions. I also tried to create a font with an outline.
Example bitmap/pixel font Visitor: Image

Perhaps with this rendering mode we can provide sharper looking fonts as the current ones with lower resolution textures at the same time. If it can only be used together with 8-bit images, this seems to be best way to use this mode in Raydium for now. Looking at the PDF the method seems to be very useful for highly scaled decals.

It doesn't require any extra dependency and you have it already running. I see no reason why not to commit it. Possibly we should add two methods to use it, one with and one without using shaders, and/or a fall back mechanism to not using anti aliasing when shaders are not available. I've no further idea for what we can use it now, but perhaps we will really want it in the future for serious intentions. :mrgreen:


Top
 Profile  
 
PostPosted: Sat Aug 29, 2009 12:15 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Another idea could be "big logos", to create short logo of the engine or the application for instance, like you seems to do on the iPhone. A sort of quick zoom on Raydium logo at the startup of the application would be an example. It requires things that the current implementation cannot do (like colors for instance), but it's a good playground to push research further :)


Top
 Profile  
 
PostPosted: Fri Sep 04, 2009 11:23 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Well, I pushed a bit experimentation and was able to to something with colors and "multiple layers" :
Image
It's just a preview, the full image is here: http://ftp.cqfd-corp.org/raycap_atm_rgba.jpg

The original texture would require 64 MB of memory (4096x4096 RGBA) and this result requires only 64 KB ! (2 textures 64x64 RGBA) ... it's ... just ... amazing ! :) And you can zoom forever without any noticeable artifact ... just like a vector picture !

But the ATM textures for this example were a bit hard to create:
- With Inkscape, I generated a 4096x4096 image with the "R" letter from the SVG logo that st (brilliantly) created.
- Using GIMP, from this picture, I made 2 black and white pictures, with only the outline of the "R" on the first, and only the "R" itself on the second.
- I then generated the two corresponding 64x64 distance field textures (ATM). A distance field is a 8 bits textures.
- In GIMP again, I've created 2 new textures, using ATM textures as "layer mask" (alpha channel, in other words) and I've used the RGB channels to "paint" my textures. I've used color gradients, since you can't "draw" anything else in a 64x64 texture without horrible results when zooming (in Raydium, I mean). That's why I used two textures, the outline of the letter would have look ugly if it was only "painted".

I'm not sure that big bunch of text is very easy to understand, but that's only a sort of Work In Progress that may stimulate your ideas about what we can do with this wonderful-but-useless feature :)


Top
 Profile  
 
PostPosted: Fri Sep 04, 2009 1:10 pm 
Offline

Joined: Tue Jul 08, 2008 2:37 am
Posts: 181
Awesome! :shock:

These new options, using colors and different layers, open a new texture dimension within Raydium.
It really remembers me significantly of having real vector based texture files. Attired in your idea showing a short engine intro at startup, we could also use this for a kind of a loading screen, where some resources (usual things that comes first like caching sky textures) are being loaded, but this probably requires some more work (e. g. Vicente's "flexible downloading" idea) to play the intro smooth.

I'm not thinking of using this method only for fonts anymore. I'm thinking about to use ATM everywhere a texture is in use.
While following and trying to understand your steps creating the ATM ready textures, I'm thinking to use this mode with my future 3D models, which I'm preparing to use them with Cal3D soon. One of them has only one 64x64 texture, which is targeted to give some kind of "old school" blocky effect. ;)
I'm currently thinking about if it'll be possible to use ATM with it and how it would look like.

Why have the two images with the "R" black backgrounds instead of transparency? Probably I totally misunderstood ATM.

Nice to hear that the (actually unfinished) SVG file was already useful for you. :D
I'd also created a Raydium logo in 3D using Blender. Perhaps I'll upload it here on the forum, too.


Top
 Profile  
 
PostPosted: Fri Sep 04, 2009 7:17 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Quote:
Why have the two images with the "R" black backgrounds instead of transparency?


You're right: I used a black background only to create a better contrast in this "demo" screenshot. The "real" textures use transparency when you don't paste them on a black background ;) The "distance data" is coded in the alpha channel of these textures, to be precise.


Top
 Profile  
 
PostPosted: Tue Sep 08, 2009 7:47 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Feature commited. Let's do ... things with it ! \o/ :)


Top
 Profile  
 
PostPosted: Tue Sep 08, 2009 8:26 pm 
Offline

Joined: Tue Jul 08, 2008 2:37 am
Posts: 181
Great! :D

I'll test and play with ATM ASAP. Just updated to the latest SVN revision.
We should provide a simple test example, perhaps some kind of intro you've talked about to show the advantages of this feature.


Top
 Profile  
 
PostPosted: Wed Sep 09, 2009 8:43 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
True, but it's probably a bit early (we still don't really know ourself what is possible with this feature) and the main difficulty of this feature is probably the generation of the ATM textures, so the demo should also show this.

We'll see :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group