gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Windows Object mode using 3d engine?

#175427 - brave_orakio - Fri Nov 19, 2010 3:53 am

Sorry if it seems I'm creating so many topics. I desperately want to upgrade the tools I created and I'm gathering as much info as I can.

Anyway on topic, has anybody created a windows mode using the 3d engine?

For a windows mode for say a dark place, I guess one could use the lighting feature or use a textured quad(with an empty circle or a colored circle) then blend with the rest of the screnery.

However, there are some window effects used on the gba specifically the ones I saw for Tales of Phantasia.

The rippling effects on Dhaos' castle when Cress uses the eternal sword to make it appear and on that time traveling machine thing probably uses sprite window mode(and and some HBLANK interrupt rippling effects).

There was some rippling effect in Castlevania:Order of Ecclesia but I have no idea how this was made.

I think Scurge: Hive probably uses sprite window mode as well when the character is behind some of the BG.

Anyway, Sprite window mode is the effect I want to emulate on the 3d engine. I have some ideas of my own but they seem to be slow to implement so anybody have some ideas?

edit: changed the title in case others misinterpret it
_________________
help me


Last edited by brave_orakio on Wed Nov 24, 2010 6:41 am; edited 1 time in total

#175429 - relminator - Fri Nov 19, 2010 6:19 am

It's called "texture warping" in 3d lingo. Meaning apply some crazy equations to your grid coordinates.

Example:
http://rel.betterwebber.com/junk.php?id=91
_________________
http://rel.betterwebber.com

#175431 - brave_orakio - Fri Nov 19, 2010 6:56 am

Interesting. I will have look into that sometime later.

Although I'm actually more interested in emulating Sprite Windows mode using the 3d engine. I only used the rippling effect from Tales of Phantasia as an example(If you wish I can detail my theory on how this was done on the GBA).

I cited the Castlevania example cause maybe it implements a similar way to the Tales of Phantasia rippling effect(Meaning maybe Sprite Windows Mode using 3d engine exists!). It seems I was wrong on that regard though.
_________________
help me

#175432 - relminator - Fri Nov 19, 2010 8:17 am

In case you missed it, I released my GL2D library.

http://devkitpro.org/viewtopic.php?f=25&t=2333
_________________
http://rel.betterwebber.com

#175433 - brave_orakio - Fri Nov 19, 2010 9:51 am

That is good stuff! Thanks!
_________________
help me

#175447 - brave_orakio - Wed Nov 24, 2010 1:41 am

Hmmm.... Looks like none has successfully created a Windows Object mode using the 3d engine? Or at least no one has any use for it
_________________
help me

#175448 - headspin - Wed Nov 24, 2010 10:03 am

This might be of interest to you http://forum.gbadev.org/viewtopic.php?t=14339
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game

#175451 - sverx - Wed Nov 24, 2010 4:34 pm

But what you want to do is to show/hide parts of the 3D scene according to a 2D mask? You could give to a 2D background more priority than the BG0/3D ... you could control it per pixel, then.

#175455 - brave_orakio - Thu Nov 25, 2010 2:01 am

headspin:

Hmmm... Looks like volumetric shadowing can solve one part of windows object mode if used properly. I'll have to do more research on proper implementation for my purposes. And I did see the post about Dementium there which I gave me the idea in the first place when I saw some screens of that game awhile back so there some promise there


sverx:

Actually show/hide parts of the 2d scene(using the 3d engine, see relminators post) with a 2d object(actually a 3d quad or several quads with a texture). Ideally some control over which layers will be affected by the window(very similar to the GBA windows object mode).
_________________
help me

#175459 - brave_orakio - Thu Nov 25, 2010 8:26 am

Can someone explain to me about the A5I3 Translucent Texture(or A3I5)? Well particularly the color index part?

The alpha part of course makes the the image opaque or translucent but what does the color index do?
_________________
help me

#175460 - sverx - Thu Nov 25, 2010 10:00 am

brave_orakio wrote:
Can someone explain to me about the A5I3 Translucent Texture(or A3I5)?


I've been using them once. You've got an 8 color texture (each pixel could use colors 0 to 7 of the assigned palette) and each texel could have one of 32 trasparency level, from full opaque (you'll see the color and no transparency) to full transparent (so it doesn't care what the color of that texel is because it won't be drawn at all...)

#175461 - relminator - Thu Nov 25, 2010 10:45 am

sverx wrote:
brave_orakio wrote:
Can someone explain to me about the A5I3 Translucent Texture(or A3I5)?


I've been using them once. You've got an 8 color texture (each pixel could use colors 0 to 7 of the assigned palette) and each texel could have one of 32 trasparency level, from full opaque (you'll see the color and no transparency) to full transparent (so it doesn't care what the color of that texel is because it won't be drawn at all...)


Hi, I've been wondering whether GRIT supports those formats. I've read the GRIT docs and I didn't see a switch for those textures.

And do you know of an editor that could make those types of textures? I've been trying to find one for weeks to no avail.


brave_orakio: I don't know if the DS 3d core supports either "scissoring" or "stencils", but if it does, it can solve your windowing problem.

Another approach I'm thinking would be calling glViewport multiple times. Or probably a very slow "render to texture".
_________________
http://rel.betterwebber.com

#175462 - sverx - Thu Nov 25, 2010 2:44 pm

I don't know of any tool that supports that, maybe some exists, but it seems to me that grit wouldn't fit your needs, in this case. When it happened to me to use such a texture, I made a gray scale image and I saved it as raw, and I used it for the 5 alpha bits. Since I just wanted to make a black quad I just had to zero out the 3 color bits and define color 0 as black in the texture palette. If you need 8 different colors you could make another image, say a 16 colors one which just uses the first 8 out of 16 colors total and 'OR' the two images in the DS memory, then put the result in your texture VRAM bank.

Don't know if it would be good enough for your needs, of course.

#175463 - relminator - Fri Nov 26, 2010 1:33 am

Thanks, I've been doing these A5I3 textures procedurally. It never occured to me to use raw binaries. LOL

BTW, someone from IRC told me while ago that GIMP(via plug-in) supports A5I3 and A3I5. Though I haven't used GIMP so I don't know its plugin system.
_________________
http://rel.betterwebber.com

#175465 - brave_orakio - Fri Nov 26, 2010 2:27 am

Oh, don't worry about the tools. The reason I'm asking about all this is because I'm upgrading my own tools to be compatible with the DS 3d engine and hopefully openGL(and hopefully 3ds? >:-D).

I'm convinced that making 2d games using the 3d engine seems to be more flexible and powerful.

Oh and has anybody played Zelda spirit tracks? I was playing that last night and I got to the 3rd part of the spirit tower with the dark areas. Is this polygon shadowing? This is the effect I want to achieve.

Although reading up on polygon shadowing, I was kind of hoping that I could use textures instead of shaped polygons for this.
_________________
help me

#175466 - coreyh2 - Fri Nov 26, 2010 7:27 am

Here is the link to the gimp plugin.
http://weirdfox.com/?id=18

Install python, PyCairo, PyGObject
http://gimp-win.sourceforge.net/faq.html

Install gimp
stick the py file into the plugins folder
then the file format gets included in the save as menu.

I haven't actually checked to see if the output files work.
_________________
Deadening 2

#175473 - brave_orakio - Tue Nov 30, 2010 1:49 am

Here is a video link of Zelda: Spirit tracks to the part that I'm talking about

Spoilers for those that never played it before:

http://www.youtube.com/watch?v=yzlOCwiI6Fg

It looks like shadow polygons but I'm not sure since I'm not a 3d programmer yet. If it isn't shadow polygons can someone tell me what technique is used in this is?

edit: I'm not sure if it's against forum rules to post video links. I read the rules but and all I saw was posting links about warez but nothing about videos. Mods, please tell me if I'm out of bounds here.
_________________
help me

#175475 - sverx - Tue Nov 30, 2010 1:18 pm

I'm not sure which part of the video you're talking about, but what I've seen seems that it's using some tri/quads with solid black instead of textures when they want to hide the details...

#175479 - brave_orakio - Wed Dec 01, 2010 1:39 am

Yeah that's the part I'm talking about. I did think it was like that too but when I saw the ghosts they were making "holes" in the solid black part making the BG details visible wherever they passed. Not sure if it can be seen in the video though
_________________
help me

#175480 - sverx - Wed Dec 01, 2010 10:56 am

Yes, it's visible at about 4:00 ... looks quite cool...

#175485 - brave_orakio - Thu Dec 02, 2010 6:44 am

I've been reading up on the DS specifications and I was wondering about the depth test attribute?

Could it be possible that this was used to create the Stencil Buffer(I think that's what its called) in Zelda: Spirit Tracks? Although there was something about rendering order that I couldn't quite get.

The idea would be to create a shape poly of the area you want to be seen, say an almost circle, then make that completely transparent(or just translucent depending on what you want) and set the depth test attribute (On all polys?). The depth of everything you don't want to be seen should be greater than the shaped poly you used so that the only parts rendered are whats beneath the transparent shaped poly
_________________
help me

#175486 - elhobbs - Thu Dec 02, 2010 7:02 am

the depth test on the ds only supports less - and on a a per poly basis equal. it does not support turning the depth test off or a greater mode. the equal mode has some issues. it really only works well if you draw the same triangles twice. the second time with the depth equal poly attribute set.

#175487 - brave_orakio - Thu Dec 02, 2010 9:48 am

Yes, looking back there are some flaws with my theory. And being transparent, the shaped polys(Should've called it mask polys) aren't even drawn in the first place so I'm not sure if there will be a depth test.

Perhaps the stencil buffer was an abuse of the hardware polygon shadows?
_________________
help me

#175488 - elhobbs - Thu Dec 02, 2010 1:47 pm

I suspect fog may be involved. there are some interesting things that can be done with fog.

#175491 - relminator - Fri Dec 03, 2010 9:17 am

Anyone willing to post a screenshot? My connection can't handle vids right now.
;*(
_________________
http://rel.betterwebber.com

#175500 - brave_orakio - Mon Dec 06, 2010 1:37 am

Sorry, I've been out for a while. I can't find screenshots of this area!

edit: relminator here is a link to a guide

[url]
http://www.zeldadungeon.net/Zelda13-spirit-tracks-walkthrough-05.php
[/url]

Go to the section: 5.3 Tower of the Spirits, Part 3

There's a picture of a nocturn, one of the enemies in the level. The non black part you see is the background of the level. When part of the nocturn is exposed to "lighted" areas, that part of the creature will have its own texture instead of the see-through effect, while the rest of the creature in the "dark" areas still has the see through effect.
_________________
help me