View Single Post
Old 11-15-07, 11:41 AM   #13
ref
Grey Wolf
 
Join Date: Nov 2005
Location: Mar del Plata, Argentina
Posts: 871
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by iambecomelife
I tried adding reflections once by importing the hull object of a modded ship with the latest version of Pack3d. I ended up with a corrupted, messed-up texture all over my ship. Do you guys have tips or a tutorial? I hope it really does take a few moments to correct, since I'll probably find a way to complicate it needlessly. :rotfl:
Sorry I missed the post or I'll have answered earlier.

Most likelly your problem was that the reflection object (reflect_XXXXX) has the wrong textures in the root node.

Here's an example:
00000000 04 00 00 00 64 00 00 00-4A 00 00 00 2B 46 AB 91 ....d...J...+F..
00000010 80 FC 7A 87 00 00 00 00-00 00 00 00 45 3C 75 B6 ..z.........E<u.
00000020 6C BC 5B FF 00 01 00 00-00 00 00 00 00 00 7A 28 l.[...........z(
00000030 A0 32 00 00 00 80 00 00-00 00 00 00 00 00 02 00 .2..............
00000040 00 00 29 59 46 AB B3 BB-99 52 D9 67 46 AB B5 BB ..)YF....R.gF...
00000050 99 52 00 00 00 00

Values in red are unknowns.

First the header : 04 00 00 00 64 00 00 00-4A 00 00 00
All dwords, type, subtype and block size (must be equal to the remaining bytes of the block.

Second IDs : 2B 46 AB 91 80 FC 7A 87 00 00 00 00-00 00 00 00 45 3C 75 B6 6C BC 5B FF
Al int64 (8 bytes), Self ID, parent ID and 3d object ID.

Third visibility : 01
Boolean, 00 unvisible, 01 visible

Fourth position : 00 00-00 00 00 00 00 00 7A 28 A0 32 00 00 00 80 00 00-00 00 00 00 00 00
All floats (4 bytes), rotations are in radians : x,y,x, rotation x, rotation z, rotation z.

Fifth number of textures : 02 00 00 00
Dword
Sixth Textures IDs : 29 59 46 AB B3 BB 99 52 D9 67 46 AB B5 BB 99 52
Int64 (8 bytes) varies according to the number of textures (fifth entry)

In this example you have a main model with two textures (the IDs are the ones in the material nodes), when you import a model with pack3d, this are referenced in each face by order, 0 for texture one, and 1 for texture two, in order to have the reflection correct, (assuming that your reflection model has the same number of textures than the main one), the root node for the reflection object MUST have the same number and order of textures, if the order is different you will have for example the deck with the hull texture and viceversa, if you have less textures sh3 will replace the non existing reference with the texture in the first "slot".

The best way to ensure that the textures are ok is this:

1) Copy the type 04 node of the object, then replace the IDs (id, parent and 3d object) with the ones from the reflect_XXXX object
2) Set the visibility byte to 0
3) Replace the type 04 node of the reflection with the one you've just created.


Ref
__________________
ref is offline   Reply With Quote