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 > Using 3d

#121818 - bigboicee - Thu Mar 15, 2007 3:19 am

I always wondered, since the DS can only render 2000 polygons on one screen, is that a memory problem or a processing power problem?

Also what program would be best to produce, texture, and animate my 3d models?

What tutorial should I look at for using the extra RAM in the SCSD?

Is there anyone else working on any homebrew 3d?

#121821 - Firon - Thu Mar 15, 2007 4:17 am

Edit: see below.

Last edited by Firon on Thu Mar 15, 2007 4:39 am; edited 1 time in total

#121823 - tepples - Thu Mar 15, 2007 4:32 am

bigboicee wrote:
I always wondered, since the DS can only render 2000 polygons on one screen, is that a memory problem or a processing power problem?

Memory. Just as each 2D core can see only 128 sprites at once, the 3D core can see only 6,144 vertices at once. If you draw a quad as a quad rather than as two triangles, however, it will occupy only four vertices rather than six.

Quote:
What tutorial should I look at for using the extra RAM in the SCSD?

To make the SuperCard RAM writable, see NDSTech:FlashCartridges.

Quote:
Is there anyone else working on any homebrew 3d?

I've seen Eurotunnel in DSOrganize's homebrew database.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#121832 - HyperHacker - Thu Mar 15, 2007 5:57 am

Could you do something crazy like upload new vertex data every few scanlines?
_________________
I'm a PSP hacker now, but I still <3 DS.

#121833 - gabebear - Thu Mar 15, 2007 6:00 am

The DS has space for 6,144 vertices in vertex RAM and up to 2048 polygons in Polygon RAM. If a polygon is clipped that will increase the number of vertices(and maybe the polygons) that that polygon uses.

Strips are supported on the DS, strips of quads eat up 4 vertices for the first quad and then 2 vertices for each following quad. Quads seem to eat up Polygon RAM faster than Triangles so you can only fit about 1700 quads even if you use one giant quad strip.

#121843 - silent_code - Thu Mar 15, 2007 7:21 am

yes, clipping increases both ram usages. because of that and depending on your game, you should always leave a fraction (like 10 or 20%) of both rams free for clipping compensation.

despite of that you can create quite complex scenes and the hardware will still run quite smoothly.

ps: there is quite a bit of 3d homebrew in development, but as the hardware isn't figured out completely, yet, it will take some time till "full" 3d hb games come out.


Last edited by silent_code on Sat Mar 17, 2007 2:26 pm; edited 5 times in total

#122080 - gabebear - Fri Mar 16, 2007 10:38 pm

Just to clarify, there are plenty of times when you do want to use quads.

You can only use about 1700 quads, and since many times it would take twice as many triangles to make the same mesh you do want to use quads, because you only get about 2000 polys if you use triangles. If you are making things with flat quad-shaped sides it is better to not break up those quads. If you make cubes it would take 12 triangles or 6 quads; both triangles and quads eat up the same amount of vertex RAM in either case.

I end up with strips of planar quads in my models quite often (i.e. tubes). Strips of quads are the most efficient way to draw stuff on the DS.

If you only use triangles then it doesn't make much difference if you use strips or not since you will run out of vertex and polygon ram at the same time. If you make good use of quads and strips then you can get quite a bit more performance on the DS.


Last edited by gabebear on Sun Mar 18, 2007 12:24 am; edited 1 time in total

#122087 - sajiimori - Fri Mar 16, 2007 11:17 pm

Our background artists use a lot of quads because it uses less vertices.

Our character artists have often tried to use quads, but find that skeletal animation bends the quads in unexpected places which can cause them to drop out. As a result, quads are rarely used on character models.

#122129 - tepples - Sat Mar 17, 2007 4:33 am

If a character model includes anything spherical, you can make a decent sphere approximation that includes quads. Animal Crossing Population Growing for GameCube uses a deltoidal icositetrahedron made of 24 kite-shaped quads, while Katamari Damacy for PlayStation 2 uses its dual, a small rhombicuboctahedron containing 8 equilateral triangles and 18 squares. Of course, use triangles to help the joints blend better.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#122160 - silent_code - Sat Mar 17, 2007 2:32 pm

i edited that BS out of my previous post, as you are right. you can model stuff with fewer quads, for what you'd need twice the number of primitives when using triangles.
though i wrote "until you really need quads". joint regions of skinned character meshes are one good example for when not to use quads. but quads can also give you very strange lighting, when not done right.

but after all, i overdid it a bit in my post, so i apologize for that and for putting words in your mouth, gabebear.

#122241 - gabebear - Sun Mar 18, 2007 1:22 am

Hey, since some people with DS modeling experience seem to have shown up, I have a question. Are there any modeling tools out there that can be restricted to only make(and maintain) planar polygons in a model?

I'm mainly familiar with Blender(which I'm pretty sure can't do this), but any modeler that can be made to only use planar polygons would be REALLY useful. I was thinking about making a "simple" model editor for the DS that lets you easily maintain planar polygons and some other DS-specific features. I'll almost certainly never get around to making it, but it could probably make some money.

#122249 - shash - Sun Mar 18, 2007 2:43 am

gabebear wrote:
Hey, since some people with DS modeling experience seem to have shown up, I have a question. Are there any modeling tools out there that can be restricted to only make(and maintain) planar polygons in a model.


Probably plugins exist for the popular modellers (Max, Maya, etc) to check if the mesh is "correct". If not (I don't know, but I never needed it, so I didn't do any research), writing one would be a lot less work than doing a full blown modeller, imho. And probably, graphicians will prefer to work with a modelling package they already know :)
_________________
http://shashemudev.blogspot.com

#122292 - Sausage Boy - Sun Mar 18, 2007 1:51 pm

I don't really have a clue, but I read this quote in a guide called Using Maya: Polygonal Modeling

Quote:
* You can ensure planarity by setting the Keep New Faces Planar option on in the Tool Options menu, or by toggling Ensure Planarity on in the Tool Settings window for the Create Polygon Tool and the Append to Polygon Tool. See "Creating new polygons" on page 26, "Appending to polygons" on page 33, and "Keeping new faces planar" on page 140 for details.
* Non-planar quads can be fixed using the Split Polygon Tool (see Chapter 14, "Splitting and Subdividing Polygons" for details).

_________________
"no offense, but this is the gayest game ever"

#122310 - ikaris - Sun Mar 18, 2007 5:14 pm

Maya's Ensure Planarity only works when using the Create / Append Polygon tool to create a new polygon from scratch.

However, most people won't work this way... it's probably better to do this instead:

In Maya, after you have created your model, select it and go into Face mode. Now open the Select Using Constraints... tool

(In Maya 8.5, it can be found in Select > Select Using Constraints)

In Constrain, choose "All and Next"

In the Properties section, choose "Non-Planar" in the Planarity option.

All non-planar faces will then be highlighted.

You can then either make them flat (difficult), or triangulate them (recommended).

Leave the rest as is, since they are planar.

IMPORTANT: When you're done, click "Close and Reset" in the Select Using Constraints window, or you'll continue to only be able to select non-planar faces.

#122325 - Tantrum - Sun Mar 18, 2007 6:32 pm

bigboicee wrote:
Also what program would be best to produce, texture, and animate my 3d models?


I'd love to know the answer to this, too. I'm not a modeller, I'm a programmer, and I'm having a really tough time with full-on modelling suites. Even when I do get something made then I have to use a maze of exporters which usually a) muck up the texture coords, b) muck up the normals, c) crash, or d) just plain don't work and e) all of the former.

Looking on the net for low-poly models hasn't helped me either as a 200-300 low-poly model is still way too high for my use.

In the end I wrote a dumbRenderer (tm) routine that takes simple coords and builds a really dumb model by making huge assumptions. So I get wasteful, blocky models, but at least I get something :| However, it's so low-poly and fugly that I can't in good conscience leave it that way. It's useless for creatures too, so I'm reduced to using 3d 'sprites' (which has no future as I haven't the ram free for the necessary amount of creatures and animation).

What I need is a dumbed down modeller for ultra low-poly models and low-res textures with a 100% working exporter and/or importer for the DS. Not asking much, am I? :)

bigboicee wrote:
Is there anyone else working on any homebrew 3d?


Me :) Here's a screenie...

[Images not permitted - Click here to view it]

I'd much rather that the enemies and NPCs were models rather than 'sprites', that way I can have then move properly and react to situations. If I can't find a package to help me then I'll be writing a dumbCreatureRenderer that builds a creature from small stock body pieces that I can draw on graph paper :|

Any anyone has any suggestions of tools that can ease the pain then please let me know.

#122328 - relpats_eht - Sun Mar 18, 2007 6:41 pm

Milkshape 3D is the best low polygon model editor I have used, pity it is only free for thirty days. Using Milkshape, I have no real problem making a model of a person with about 110 polygons. I also have a quite incomplete model loader for it on the DS, I wouldn't call it good enough to hand out yet, but if anyone wants to see it, they may feel free to contact me.
_________________
- relpats_eht

#122332 - Eclipse - Sun Mar 18, 2007 6:55 pm

Tantrum wrote:
Looking on the net for low-poly models hasn't helped me either as a 200-300 low-poly model is still way too high for my use.


Unfortunately your not going to be able to get models really any lower then that if you want them to deform and look at all resembling anything like a human. I don't have any experience doing DS models, but I have modeled for a long while. I'm just curious why you don't use the program with the best exporter (I don't know what this is). But there has to be one of the big programs out there that is able to do DS stuff since it's all out there on the market. Only thing is their plug-ins might be made in-house.....so in the end, who knows I guess...

#122333 - Lick - Sun Mar 18, 2007 7:01 pm

With nice textures, we don't need high poly. Too bad we have no texture filters. Hehe.
_________________
http://licklick.wordpress.com

#122375 - ikaris - Mon Mar 19, 2007 12:44 am

Dumbed down modeler for the everyman ?

I HIGHLY recommend SketchUp...

it has a free version too.

http://www.sketchup.com/

#122437 - Tantrum - Mon Mar 19, 2007 9:55 am

relpats_eht wrote:
Milkshape 3D is the best low polygon model editor I have used, pity it is only free for thirty days. Using Milkshape, I have no real problem making a model of a person with about 110 polygons. I also have a quite incomplete model loader for it on the DS, I wouldn't call it good enough to hand out yet, but if anyone wants to see it, they may feel free to contact me.


You star! Milkshape is exactly what I need for creature work :D Once I'm a little more familiar with it I'll take you up on your offer of the loader code. Thanks again.

#122444 - kusma - Mon Mar 19, 2007 11:46 am

Not to be the party-pooper here, but compared to "proper" applications like 3dsMax and Maya, Milkshape is not exactly top-notch - especially for low-poly modeling. Well well, at least it's cheap, so you might get more value for your money.

#122457 - tepples - Mon Mar 19, 2007 1:59 pm

If I were to write a Free low-poly modeling program from scratch as part of project DX, what would anyone want?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#122460 - memoni - Mon Mar 19, 2007 2:18 pm

Speaking of SketchUp, does someone have simple Collade mesh reader around? The Google earth files are just zipped .dae files (with a folder and some extra xml to specify some metadata).

#122465 - kusma - Mon Mar 19, 2007 2:50 pm

tepples wrote:
If I were to write a Free low-poly modeling program from scratch as part of project DX, what would anyone want?

Some basic features that usually make up a good base for a modeler:
- vertex, edge, boundary-edge, polygon and shape edit modes
- extrude polygon(s) - by polygon-normal and by vertex-normal
- bridging edge-loops - with twisting, subdividing, and scale-biasing
- inset / outset polygon
- cap holes / automatic edge loop filler
- directly-on-mesh cut-tool that should detect and visualize what you're cutting at - vertex, edge or nothing.
- automatic uv-mapping
- a comprehensive uv-mapping editor with support for stuff like uv-relaxing, pelt-mapping (yeah right kusma)
- skinning with support for weighting based on bone-distance (and preferably a way of adjusting the falloff of the distance to the bone for both end-points -- something like the feature in 3dsMax would rule)

(Basicly I'm listing up the editing-features I use the most in 3dsMax ;))

#122474 - silent_code - Mon Mar 19, 2007 4:01 pm

what exactly does one need planar polygons for? level geometry? ... what? ??? *curious*

i'm having no problems with meshes. just take any source format (i work with cinema 4d, my modeller buddy works with lightwave or something) import it into milkshape (30 bucks isn't that expensive!) and export it to a format my so-called engine reads. my exporter recalculates some stuff like normals and optimizes it (like eliminating redundant vertices).

#122477 - kusma - Mon Mar 19, 2007 4:39 pm

silent_code wrote:
what exactly does one need planar polygons for? level geometry? ... what? ??? *curious*


I wasn't taking about planar polygons, but polygons in the sense that 3ds handles. It's just triangulated behind the artists back in a simple way, and if they get very distorted, they are visualized wrong. It's just sometimes simpler to keep polygons on a higher level, and do the splits yourself when you need to define edge. In 3ds you can still edit the triangulation if you want to.

#122496 - HyperHacker - Mon Mar 19, 2007 8:30 pm

tepples wrote:
If I were to write a Free low-poly modeling program from scratch as part of project DX, what would anyone want?
The source code. :-p
_________________
I'm a PSP hacker now, but I still <3 DS.

#122524 - gabebear - Mon Mar 19, 2007 11:16 pm

silent_code
Quote:
what exactly does one need planar polygons for? level geometry? ... what? ??? *curious*


The DS is only able to draw planar quads correctly. So if your model uses quads they either need to already be planar or be triangulated. Most 3D tools use triangles for everything, so it can be difficult to maintain planar quads.

The DS supports ~6000 vertices and either ~2000 triangles or ~1500-1700 quads. If you mix quads and triangles you get somewhere between 2000 to 1500 polygons. If you triangulate all your quads into triangles then you are wasting a lot of the power of the DS.

1500 quads = 6000 vertices / 4 per quad (not using strips; runs out of vertex RAM)
1700 quads = hard limit(runs out of polygon RAM)
2000 triangles = hard limit(runs out of polygon RAM)

You can see how fast polygon and vertex RAM is filled up by looking at the RAM_COUNT(4000604h) register.

I don't like Sketchup because I have no idea how to access it's file format, and the $500 for the pro version is kinda steep. Sketchup is really cool for doing Google Earth stuff, but I'd never use it to make models for a game.

#122577 - silent_code - Tue Mar 20, 2007 11:14 am

gabebear wrote:
I don't like Sketchup because I have no idea how to access it's file format, and the $500 for the pro version is kinda steep. Sketchup is really cool for doing Google Earth stuff, but I'd never use it to make models for a game.


agreed, plus there's no low-level control you'd need to be efficient enough for the nds.

ps: i know the other stuff already (even though i messed up recently), but never mind. :^) just wanted to know what ppl were talking about, because i know planar polygons as sets of triangles with a (constant) shared normal. that's pretty much the same thing that kusma described (if i got him right - although it was gabebear who started the planar thing).

#122612 - gabebear - Tue Mar 20, 2007 7:43 pm

ya, the term "planar polygon" is ambiguous, and it gets really weird when you start mixing terminology from different 3D programs. To me "planar polygon" means a polygon where all points lie on one plane(any arbitrary plane) and obeys the regular constraints that individual polygons are supposed to obey(a.k.a. not concave or twisted).

In the terms I'm used to dealing with I'd consider a group of triangles that are all using a constant normal as a face.

#122613 - sajiimori - Tue Mar 20, 2007 8:32 pm

Though it's barely relevant to this discussion, keeping neighboring polys coplanar is important for autopartitioning BSP collision.

If a couple neighboring faces almost lie on the same plane, but are slightly askew in a convex manner, the plane of one poly will cut under the other, making a very thin volume. Such volumes wreak havoc on fixed-point math.

This isn't a technicality or academic concern. Wobbly geometry can cause serious headaches for collision detection. When modelling geometry for autopartitioning BSP collision, artists should delete all redundant edges and have the editor highlight non-planar faces.

#122619 - memoni - Tue Mar 20, 2007 9:11 pm

Quote:
I don't like Sketchup because I have no idea how to access it's file format, and the $500 for the pro version is kinda steep. Sketchup is really cool for doing Google Earth stuff, but I'd never use it to make models for a game.


As I said earlier, the Google Earth file format (.kmz)--which the free version exports--is a zip file with a .dae file (collada) inside it.

I would not model a game character with Sketchup, but it would be nice alternative for level editing.

I'm currently using Silo (http://nevercenter.com/) and I'm very happy with it. It has good polygon editing tools. Texture mapping on the current version is weak, but the 2.0 looks promising on that area too. Unfortunately it is modeling only. And it is cheap.

Tepples, how about contributing to Blender instead of building an editor from scratch? Even if Blender has a bit nasty workflow sometimes, I think you would be able to make larger impact that way :) Plus you would have quite solid ground to work on.

#122627 - Ant6n - Tue Mar 20, 2007 9:39 pm

Would it make sense to use models that are made like warcraft III models? they dont really seem to use a skeletal approach. And the poly count seems pretty low, thought I dont know how low.

#122647 - tepples - Tue Mar 20, 2007 11:37 pm

memoni wrote:
Tepples, how about contributing to Blender instead of building an editor from scratch?

Because I don't think I could single-handedly shrink Blender to run on the DS. And would Blender work well on my six-year-old PC?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#122725 - memoni - Wed Mar 21, 2007 3:39 pm

Tepples, ah you want to do some modelling magic on DS.

I don't know about the 6 year old computer but it runs quite fine on my MacBook laptop which has a video card that runs on steam-engine (or some other archaic tech that Intel decided to produce).

#122737 - gabebear - Wed Mar 21, 2007 4:45 pm

It would be nice to have a materials editor that runs on the DS. Getting a faithful representation of what the model will look like on the DS's screen inside a 3D program isn't very likely.

#122749 - ikaris - Wed Mar 21, 2007 6:41 pm

In Maya, you can turn off bilinear filtering in the viewport...

while it's not 100% perfect, at least it's closer to what it will look like on the DS...

Shading > Hardware Shading

Change "Texture filter" to "Unfiltered"

Edit: spelling


Last edited by ikaris on Tue Mar 27, 2007 11:59 pm; edited 1 time in total

#123389 - silent_code - Tue Mar 27, 2007 9:31 pm

OFFTOPIC: "we use the newest ultar-high-power shader techniques to make it look like it was rendered on an nds! - in *REALTIME*" ... i'm a jerk, i know ;^p

#162733 - mreaves - Thu Sep 11, 2008 1:57 pm

silent_code wrote:
what exactly does one need planar polygons for? level geometry? ... what? ??? *curious*

i'm having no problems with meshes. just take any source format (i work with cinema 4d, my modeller buddy works with lightwave or something) import it into milkshape (30 bucks isn't that expensive!) and export it to a format my so-called engine reads. my exporter recalculates some stuff like normals and optimizes it (like eliminating redundant vertices).


Because if you have any quads in your level they need to be planar, otherwise they will get broken into two triangles. Triangles are always planar, quads may or may not be.

#162744 - tepples - Thu Sep 11, 2008 9:06 pm

Every quad is theoretically made of two triangles, each of which defines a plane. The angle between these two planes is called the "dihedral angle", labeled φ. Of course, you can't always have perfectly planar quads (φ = 0.0000000000?) due to coordinate roundoff error. Within what dihedral angle would a quad be "planar enough" for the DS 3D hardware to render it correctly?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#162746 - TwentySeven - Thu Sep 11, 2008 10:10 pm

Yep. DS rendering hardware doesn't seem to give a poop about slightly invalid quads, or even really invalid ones as far as my testing has turned up.

#162749 - silent_code - Thu Sep 11, 2008 11:44 pm

Just make sure joint regions are triangles in skinned meshes, that's it. Nothing more to add to this old thread.
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.