cbhacks / CrashEdit

Unofficial Crash Bandicoot 1/2/3 Level Editor
https://www.cbhacks.com/tools/crashedit/
Other
135 stars 27 forks source link

Texture rendering support for Crash 1/2/3 scenery #112

Closed ughman closed 4 years ago

ughman commented 8 years ago

The Crash 1 textureinfo format is known, but not the Crash 2/3 one. I suspect it's probably similar to the format in Crash 1 and the textureinfo format in the object models.

NetyashaRoozi commented 8 years ago

Well with warenhuis's program we can already view the maps with vertex shading also when did you get crash 1 support for textures in the scenery? is it in the newest version that has to be compiled?

ughman commented 8 years ago

also when did you get crash 1 support for textures in the scenery?

Oh that's true, I haven't gotten that either. I'll edit the title.

NetyashaRoozi commented 8 years ago

Also does this include export?

ManDude commented 8 years ago

I suppose not.

warenhuis commented 8 years ago

I have tested the texinfo's from CB2 and CB3 WGEO's real quick. They are not just similar to the texinfo of object models, they are EXACTLY the same.

Edit: result of Warped intro scenery untitled

ManDude commented 8 years ago

Sweet.

Now it just needs transparency.

NetyashaRoozi commented 8 years ago

oh yeah thats one thing I forgot to ask on the Crash Bandicoot 2 ripper, It needs transparency support

warenhuis commented 8 years ago

I will work on the transparency exporting, but bear in mind that some textures that appear to have transparency don't have it. The flame sprites for example, are ADDITIVE textures (as specified by the texinfo's colormode). That means that the black pixels are interpreted as fully transparent by the GPU and that any other color will mix with whatever pixels are on the background. So you will STILL see a black background on those after export.

ManDude commented 8 years ago

Oh so that's how it works, it was really bothering me how they did that.

warenhuis commented 8 years ago

Also important for this feature: for proper rendering, vertex colors on textured faces should be twice as bright as non-textured ones. So for example RGB 0, 2, 26 would become 0,4,52 etc..

Edit: The colormodes in the texinfo are as follows: FCCC F = 4 / 8 bit flag (1 = 8-bit, 0 = 4-bit) CCC = colormode (0 to 7) 0 or 1 = translucent face 2 or 3 = additive face 4 or 5 = subtractive face 6 or 7 = standard face

The texinfo index in a triangle face is here: DD AA BA BB .................... CECC DD + E = 0xDDE = textureinfo index in 5th item (starting from 1)

The texinfo index in the quad face is here: EE AA BA BB DF DD CD CC EE + F = 0xEEF = textureinfo index in 5th item (starting from 1)

This should do it for the scenery of CB2 and CB3?

warenhuis commented 8 years ago

Currenty looking for ways to replace parts of the texturesheets, so as to create 'custom' textures.

In the link an example: https://www.youtube.com/watch?v=N0bSn87-pwU&feature=youtu.be

AraHaan commented 8 years ago

hey uh @warenhuis can you plz tell me exactly what you did to get the textures colored or any tools I can use to get them that way because I will need all of the textures and yeah I can tell that all of the textures was buncled and they seem to probably be squares. My best bet is to look at 1 square of something to have idea on size. Or to guess 64 x 64 px.

Oh and you know how to render all of the zones with their sceneries together in 1 view? because I would love a master view of the entire level at 1 time. Because I think NaughtyDog's original tool did that and the zones separately so they can zoom in on a particular area.

Oh and in case ppl do not know the slot boxes that change and what not have a sub type of 25. And the time Trial clock have a type of 34 and subtype of 28.

ManDude commented 8 years ago

We know that, too. Crash 2 and 3 have a limit of about 3,000 textured + shaded polygons, and levels usually have like 100,000 so you can't see the whole level in-game.

ghost commented 7 years ago

Any news of adding texture support for textures? I opened lava level,and want to see it with textures