HDNes with 3D graphics?

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
User avatar
ulfalizer
Posts: 349
Joined: Fri Mar 08, 2013 9:55 pm
Location: Linköping, Sweden

HDNes with 3D graphics?

Post by ulfalizer »

Hello,

Has anyone considered something like HDNes but with the added capability to replace (groups of) tiles with 3D models? That's what I had originally planned for Nesalizer, but since I seem to have a hard time getting around to it, I thought I'd just throw the idea out there.

The implementation I imagine is having a bunch of contexts, where a context consists of at least a context identifier and an (x,y) position on the screen. A context could be defined by a particular tile, by a tile but only if surrounded by particular other tiles, or by something more complex. With that general framework, the original graphics, replacement graphics, a 3D model, etc., could later be drawn for each context. The context identification/generation code would be decoupled from the drawing code (except perhaps for passing stuff like tile data if available), so that most of the work would turn into just identifying different types of contexts after a while. It would probably be possible to do fancy stuff like detect how far into a level a game has scrolled and generate different context identifiers depending on that.

Having an editor would be nice too, where you could e.g. select a few tiles and drag-and-drop them to have the editor generate a .png with a filename that uniquely identifies those tiles and allows them to be edited.

It might seem silly, but I've felt pretty bad over the last few years about not getting around to this, and in a way it would give me some closure if someone else implemented it. :roll:
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: HDNes with 3D graphics?

Post by rainwarrior »

There's one attempt in this recent thread: viewtopic.php?f=3&t=13552
User avatar
ulfalizer
Posts: 349
Joined: Fri Mar 08, 2013 9:55 pm
Location: Linköping, Sweden

Re: HDNes with 3D graphics?

Post by ulfalizer »

rainwarrior wrote:There's one attempt in this recent thread: viewtopic.php?f=3&t=13552
That's a cool approach, but I'm thinking of something more manual. Having as an option to assign a shape instead of importing a 3D model would probably be nice though.
Nesd4
Posts: 6
Joined: Wed Apr 22, 2015 4:02 am

Re: HDNes with 3D graphics?

Post by Nesd4 »

ulfalizer wrote:Hello,

Has anyone considered something like HDNes but with the added capability to replace (groups of) tiles with 3D models? That's what I had originally planned for Nesalizer, but since I seem to have a hard time getting around to it, I thought I'd just throw the idea out there.

The implementation I imagine is having a bunch of contexts, where a context consists of at least a context identifier and an (x,y) position on the screen. A context could be defined by a particular tile, by a tile but only if surrounded by particular other tiles, or by something more complex. With that general framework, the original graphics, replacement graphics, a 3D model, etc., could later be drawn for each context. The context identification/generation code would be decoupled from the drawing code (except perhaps for passing stuff like tile data if available), so that most of the work would turn into just identifying different types of contexts after a while. It would probably be possible to do fancy stuff like detect how far into a level a game has scrolled and generate different context identifiers depending on that.

Having an editor would be nice too, where you could e.g. select a few tiles and drag-and-drop them to have the editor generate a .png with a filename that uniquely identifies those tiles and allows them to be edited.

It might seem silly, but I've felt pretty bad over the last few years about not getting around to this, and in a way it would give me some closure if someone else implemented it. :roll:
Do you have any code or anything that showcase how to do it?
beannaich
Posts: 207
Joined: Wed Mar 31, 2010 12:40 pm

Re: HDNes with 3D graphics?

Post by beannaich »

ulfalizer wrote:The implementation I imagine is having a bunch of contexts, where a context consists of at least a context identifier and an (x,y) position on the screen. A context could be defined by a particular tile, by a tile but only if surrounded by particular other tiles, or by something more complex.
How about absolute address of the tile in CHR memory (after banking bits, etc are applied)? That is a very unique identifier and you could group them together in a json file, something like so:

Code: Select all

{
  "models": [
    { "name": "model-2.fbx", "replaces": [ "$1f000", "$1f008", "$1f010", "$1f018" ] }
    { "name": "model-3.fbx", "replaces": [ "$1f020", "$1f028", "$1f030", "$1f038" ] }
  ]
}
The emulator would then provide the X/Y position of the tiles, possibly an average of all the positions for use as an origin, and render the 3D model at that screen position (possibly subject to matrix transformations to implement a free-floating camera).

Since it's all just based on CHR address, you could replace sprites and backgrounds with the same functionality. The only problems arise with games using CHR-RAM, but that's another story.

EDIT: Replacing sprites in this fashion could be more difficult, perhaps provide a way of mapping groups of sprites to certain key frames to provide for rudimentary animation?
Post Reply