Kuribo64
Views: 19,856,723 Home | Forums | Uploader | Wiki | Object databases | IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search
03-29-24 01:18 PM
Guest:

0 users reading Shadows on Custom Models in SMG 1/2 | 1 bot

Main - Archived forums - General SMG hacking - Shadows on Custom Models in SMG 1/2 Hide post layouts | New reply

Pages: 1 2
Slacker
Posted on 08-13-13 08:16 PM Link | #30172
Hello. So I was looking at the Stormshine model that Cosmological had put up some time ago and noticed that the in-game version of the model was rendered as flat color and textures. Needless to say the planet lacks some degree of depth when shadows are absent. (Still a nice model though :)).

Now I am under the impression that shadow-like effects can be handled via textures. Fair enough. However, I am still confused about how this stuff would be done. Looking at some of the texture dumps for some SMG models, I noticed that textures for larger objects (planets), "shadows" don't seem to be included.


An example of what I'm talking about:
The flat texture for the planets "siding":

[image]


The planet rendered. (Image taken from Whitehole):

[image]



Notice the aforementioned "depth." The channel near the center of the image where the player should use wall kicks is shaded so that you can see the walls edges. Also, at the side of the planet where the player can fall off and die (near bottom of image), there is a nice gradation of shade.

So is galaxy doing something in-game, independent of texture work (shaders?) or is this just some fancy texture work?

I would love if someone could expound upon the subject. I know next to nothing about this stuff.

Thanks.

shibboleet
Posted on 08-13-13 08:17 PM Link | #30173
You have to edit the textures to add the shadow to it and texture the face where the shadow can be seen.



____________________
a

gridatttack
Posted on 08-13-13 08:18 PM (rev. 2 of 08-13-13 08:21 PM) Link | #30174
They arent any shadows in the models because the game either handles some lightning engine or nintendo models uses vertex colors.
(probably its the latter)

____________________
[image] [image]

NWPlayer123
Posted on 08-13-13 08:34 PM Link | #30181
It is the latter. Which is why we have to cheat and use textures for everything.

____________________
"I hate playing musical chats" ~ Quote of the month

Slacker
Posted on 08-13-13 09:15 PM Link | #30186
Oh so vertex colors. Thanks for the help.

I am judging from Arcanine's post, working with vertex colors is a no go at this point?

NWPlayer123
Posted on 08-13-13 09:46 PM Link | #30190
Basically. The materials section is documented, but there's no practical way of editing it aside from doing it all manually using hex editing which could take forever on bigger files.
http://www.amnoid.de/gc/bmd.txt

____________________
"I hate playing musical chats" ~ Quote of the month

Slacker
Posted on 08-13-13 10:39 PM Link | #30194
Yikes. Now that's a problem.

So let me get this straight, since vertex colors are not supported at this point in time...textures would actually have to be used to create shadows?
I'm not sure how you would even do something like that.

[quote A PolyCount-Wiki]Vertex color AO works well for meshes that use tiled textures, like environment models, because the tiling prevents unique lighting from being added to the textures. In this case texture-based AO would require a separate non-tiled texture using a second set of UVs, which would increase the texture memory and also increase the vertex count for the model (to store the 2nd set of UVs).

This addresses my main concern. Light/Shadows can be baked into smaller textures used for smaller objects (ie. a Bullet Bill Blaster), but the same process doesn't work well with the tiling textures of environmental models.


Just speculating here, would this process pretty much be:

1. Set up UV coords

2. Apply seamless texture.

3. Create semi-transparent texture which would act as shadow.

4. Set up another set of UV coordinates which would be warped to hold shadows appropriately. I'd imagine UVs might have to be overlapped? :O

5. Apply "shadow" texture on top of "diffuse" texture thus blending them together.


Correct me if my guess is wrong, (I hope it is). This sounds nightmarish. Also, I was under the impression that blending textures on the fly is somewhat slow/expensive along with what the quote says about texture memory usage.

Moreover, can the game even handle multiple UVW coordinate systems on models?

Has anybody successfully done this on complex model work? Like, are there any custom planet renderings I can look at to see how it's properly done?

Again thanks for the help.

SuperMario64DS
Posted on 08-17-13 02:54 AM Link | #30380
Posted by Slacker
Yikes. Now that's a problem.

So let me get this straight, since vertex colors are not supported at this point in time...textures would actually have to be used to create shadows?
I'm not sure how you would even do something like that.

...

...

Just speculating here, would this process pretty much be:

1. Set up UV coords

2. Apply seamless texture.

3. Create semi-transparent texture which would act as shadow.

4. Set up another set of UV coordinates which would be warped to hold shadows appropriately. I'd imagine UVs might have to be overlapped? :O

5. Apply "shadow" texture on top of "diffuse" texture thus blending them together.

Correct me if my guess is wrong, (I hope it is). This sounds nightmarish. Also, I was under the impression that blending textures on the fly is somewhat slow/expensive along with what the quote says about texture memory usage.

Moreover, can the game even handle multiple UVW coordinate systems on models?

Has anybody successfully done this on complex model work? Like, are there any custom planet renderings I can look at to see how it's properly done?

Again thanks for the help.


OBJ models cannot handle more than one UV Channel. Moreover, the OBJ Importer is not designed to.

What you described is /technically/ shadow mapping. Pretty much you set up a light field (Placing object(s) in places where you'd want light), and render that to a 2D Map, then add semi transparency or a opacity Map, which again, OBJ cannot use.

From what I've observed, neither Galaxy games use real shadow mapping, but rather vertex colouring. Objects like trees use either some form of 'dynamic' shadowing (Usually a cylinder shape which creates a shadow on the first/any surface beneath it), or a texture made to look like a shadow of the object, usually placed on a rectangular piece of geometry, in the position that the object would be placed, but slightly above (This how the majority of Sunshine's & The Wind Waker's Shadows work). Again, this method will not work, as special settings are required to have textures featuring opacity display properly in-game.

Pretty much Glem3 (Or whoever textures the models for SMG2.5), uses a rather odd method to fake shading.

Firstly, they use a base texture (Imagine grass or dirt), they repeat it several times, then re size it to a width of 1024x1024 or 512x512, or any combination of the two.

Next, it appears as if they render the pieces of the model they'd like to have shadows to 2D textures, apply opacity to that, and put it over the large grass/dirt/whatever texture.

Then when it comes to things opposite sides of an object (Notice the giant blocks found in Planet Planes) uses several textures, I guess three or four. First you have the normal block texture, then brighter/darker variants of that same texture. Those textures are used to fake vertex colouring; they give off the appearance that light is hitting an object from a certain direction, thus some sides are brighter and darker.

Thirdly, objects which appear to have shiny/several variations of itself (Obvious in 2.5's Rolling Plinko or whatever it's called) use rather larger-than-usual textures which lapse into whatever shiny/colour effect it needs to.

Now here's why this is bad: File size. To give you a bigger picture, Planet Plain's Model size is equivalent to (If not larger) than Bianco Hills, Delfino Plaza's & Ricco Harbor's Model sizes combined.

Not only do these methods limit you greatly (In terms of object & poly count), but it will cause lag if you try to place too many planets styled this way, and, it looks rather ugly; not as good as the real thing.

Pretty much there's no interest in ever doing this the right way, and no clue why. Plenty of ediotrs, importers, viewers, programs (With open soucre) and documentations which seem to understand how these models work in terms of vertex colouring & co. There's more than enough information, plenty of smart people, and many reasons to have a proper editor/importer for a format like this, but nothing has been done.

The format's not even all that complicated. If I even had half the understanding (As far as computer programming goes) of the authors of the above cited software, then I wouldn't waste a moment trying to figure this out. (I only understand PPC assembly, that's it. I can't seem to grasp several concepts of languages like C#).

So, there you have it. Either horrendously large files with low-quality and huge textures with odd shading and a time consuming development time, or blindingly bright models with no colour variations whatsoever. A rock and a hard place.

Marionumber1
Posted on 08-17-13 01:00 PM Link | #30384
As far as I can tell, Wavefront OBJ models don't even support vertex colors. We would have to use a different model format, like 3DS.

For any programmers interested in the 3DS model format, here's something would help:

http://blog.aerojockey.com/post/dice3ds

This is a Python module that lets you read data from 3DS models.

blank
Posted on 08-17-13 02:22 PM Link | #30386
Unfortunately 3DS files doesn't support vertex colors either. For some reason there is no simple 3D model format that supports vertex colors (except for PLY files, but they only support one mesh per file). So to support vertex colors you would have to use a file format such as COLLADA, which would be a lot of work.

Slacker
Posted on 08-26-13 10:13 AM (rev. 2 of 08-26-13 06:16 PM) Link | #30853
Ah, again thanks for the information all.

[quote SuperMario64DS]OBJ models cannot handle more than one UV Channel.

Oops. I wasn't even aware of this. I haven't even looked into OBJ capabilities since they're so limiting.

Yeah, that sounds pretty awful. Also, very limiting. I understand how a technique like this might be acceptable for simple models, ie. rectilinear planes and cylindrical type objects, but when things become more complex, is this method even feasible?




--Cube--
So I took a shot at this cheating-shadows-with-textures method with a cube. I fiddled around with my software's viewport and got it to display models in the same shade-less manner much how I've seen Whitehole and SMG render custom models. One texture is used.
[spoiler Cube: No Shadows][image]
Moving on, I darkened the texture a bit to mimic a geometric face that would be in shade. This gives some depth, but it's still pretty lame. Two textures had to be used of course: one for "lit" faces another for "shaded" one.
[spoiler Cube: Basic Shade][image]
Lastly, I tried to get a softer gradation of shade on the cube model. I used my image software and simply added a gradient-like effect. I needed one for the "lit" texture and one for the "shaded" one. So now in total I need four textures: fully lit (top), fully shaded (bottom), soft shaded lit, soft shaded bottom.
[spoiler Cube: Soft-ish Shaded][image]
[quote SuperMario64DS]Now here's why this is bad: File size.
Goes without saying, SuperMario64DS's point is pretty well illustrated with this. Also, since I'm taking an approach used for large environment models (that is, without packing UV's with rendered shadows), tiling the texture is a common tool. Note in the last image with 4 textures, the brick size is larger. This is because I couldn't tile the textures without completely messing up my custom painted shadow textures. If I try, the result is:
[spoiler Cube: Tiled Custom Shadows][image] Yuck, but then again, I'm probably pretty bad at this since I've never had to render shadows like this. It would be nice to see what Glem's input would be (since he's the guy that does this stuff?), but apparently he is unavailable.





--Other Model--
So since I was bored, I threw together a quick model. I wanted to see how this might work on a more complex model. Spoiler: I didn't even try texture shading after getting everything set up. Haha. I guess I'm too lazy for this stuff. Anyway, here are two renderings of the model. NOT viewport screenshots, renderings:
[spoiler Processor-Frying Rendering 1][image] [spoiler Wii-Demolishing Rendering 2][image]
Now a shot of it as if it were imported on the Wii:
[spoiler Flat Color No Shadows][image]
So my UV coordinate setup isn't perfect since I just was doing this quick for a test (as the model images so subtly imply :)). I have a fairly visible seam on the model, which made me ponder how this texture shadow stuff might work when meeting UV seams. Idk, I just couldn't be bothered.
[spoiler The Seam][image]
I did look at shading through vertex colors though. Hah, so much faster. After I adjusted my UV's, I ran a quick operation and got a nice shading effect on my model. The result is below. I left the textures off for now. This is another shot from the viewport, still in "flat-color, no-shadow" mode.
[spoiler Shading baked into Verts][image]

So yeah, what an adventure.
Posted by blank
Unfortunately 3DS files doesn't support vertex colors either. For some reason there is no simple 3D model format that supports vertex colors (except for PLY files, but they only support one mesh per file). So to support vertex colors you would have to use a file format such as COLLADA, which would be a lot of work.


Hmm. I've worked with COLLADA briefly. Had some minor troubles with model smoothing but that could have been my fault with export settings. Very sad to hear that about vertex colors though. Are you guys aware of anyone using COLLADA for other game hacks?

Anyway, sorry for the rambling, I just thought I would be useful for others to see this stuff documented. Thanks again.

FnarGod
Posted on 08-26-13 06:10 PM Link | #30871
I make custom shadow by bakin textures. But IMO the hardest part about texturing is seamless textures perfectly mapped

____________________
(layout nuked; unclosed style tag)

Slacker
Posted on 08-26-13 06:20 PM Link | #30872
Posted by FnarGod
I make custom shadow by bakin textures. But IMO the hardest part about texturing is seamless textures perfectly mapped


Oh? What resolutions are your textures? Do you think you could post the texture images as an example?

FnarGod
Posted on 08-26-13 06:32 PM Link | #30873
i use textures from the game, then i take, 'shadeless' off, and then I just bake the textures, after I map them of course. What do you use to make this btw. blender? maya? 3DMax?

____________________
(layout nuked; unclosed style tag)

Slacker
Posted on 08-26-13 06:58 PM Link | #30876
Posted by FnarGod
i use textures from the game, then i take, 'shadeless' off, and then I just bake the textures, after I map them of course.


Sorry, but I really don't understand your process. You make it sound so simple. XD

I use dumped textures like you as shown in a previous post; if I was to ever move forward with any of this stuff, I probably would make my own textures.
[quote Slacker][spoiler Cube: Soft-ish Shaded][image]

However, I had to modify the images to get certain effects. When you say "bake," doesn't that mean that you are using your 3D software to automatically generate images that use calculated shadows? Those are images I'm interested in seeing.

Posted by FnarGod
What do you use to make this btw. blender? maya? 3DMax?



I actually use 3DMax. What do you use? There seem to be a lot of Blender users on this board. :)

FnarGod
Posted on 08-26-13 07:05 PM Link | #30879
Blender, Idk ANYTHING about 3Dmax, but baking in blender is easy for me. :P

____________________
(layout nuked; unclosed style tag)

Marionumber1
Posted on 08-27-13 01:01 AM Link | #30901
Posted by blank
Unfortunately 3DS files doesn't support vertex colors either. For some reason there is no simple 3D model format that supports vertex colors (except for PLY files, but they only support one mesh per file). So to support vertex colors you would have to use a file format such as COLLADA, which would be a lot of work.


Not trying to force you into coding a COLLADA importer, but this might help:

http://pycollada.github.io/

It's a Python module for reading COLLADA modules as Python objects.

Slacker
Posted on 08-27-13 04:08 AM (rev. 2 of 08-27-13 04:16 AM) Link | #30916
Posted by Marionumber1
Not trying to force you into coding a COLLADA importer, but this might help:

http://pycollada.github.io/

It's a Python module for reading COLLADA modules as Python objects.


Way ahead of you. Took a peek at that module before. Very interesting. I'm hoping to sit down with the documentation provided and work on something useful. Frankly, though, I'm not well versed in all this hacking stuff. I know some Python coming from C# and basic Java, but I would have to really buckle down and up my proficiency to move forward.

Thanks for the suggestion though MN1!


As a side note, [user 149] requested the model I had made before (not the cube). I have uploaded it on Kuribo64's uploader in case anyone wishes to look at it and give suggestions for shading, etc.

blank
Posted on 08-27-13 04:53 PM Link | #31000
Posted by Marionumber1
Not trying to force you into coding a COLLADA importer, but this might help:

http://pycollada.github.io/

It's a Python module for reading COLLADA modules as Python objects.


That module might make it a bit easier, but writing a COLLADA importer would still be a lot of work. And since there is no actual SMG hacking going on, I'm not motivated to spend time on a project of such size.

SuperMario64DS
Posted on 08-27-13 05:31 PM (rev. 7 of 08-27-13 05:46 PM) Link | #31005
Posted by blank

That module might make it a bit easier, but writing a COLLADA importer would still be a lot of work. And since there is no actual SMG hacking going on, I'm not motivated to spend time on a project of such size.


Have you considered that not much may be going on because of the lack of a proper editor or importer?

Custom Character models, nice shading... Would motivate me, that's all the nice stuff I'm used to. I haven't really gotten into this because OBJ is one of the most awful formats out there for when it comes to games like this. It should only acceptable for N64 quality games, and even so, N64 games like Super Mario 64 now feature a DAE importer, it's all backwards now.

I'm not entirely sure myself where you'd start with a project like that though, there's still a lack a proper documentation. If you wouldn't be willing to do it, I'm not sure who will. I don't know enough about any type of programming to do anything myself, and I'm the one who would like to see this happen the most.

Posted by Slacker
Are you guys aware of anyone using COLLADA for other game hacks?


And as I said above, the Super Mario 64 hack. There's a user here named Skelux, he's the one who made the Multiplayer modifications for Super Mario 64, as well as the model importer. He's a member here because of the Super Mario 64 DS section of the site.

Other than that, I also know of BlackJax. He made BrawlBox, I'm not sure he'd be interested in this format.

I know Chadderz as well. He offered to make several editors for the game (He already had the base for a Mario Kart Wii DAE importer), but he's too busy with his studies to help out.
Pages: 1 2

Main - Archived forums - General SMG hacking - Shadows on Custom Models in SMG 1/2 Hide post layouts | New reply

Page rendered in 0.069 seconds. (2048KB of memory used)
MySQL - queries: 29, rows: 235/235, time: 0.015 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.