SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
12-30-11, 06:55 PM | #376 | |
Black Magic
|
Quote:
|
|
12-31-11, 12:42 AM | #377 |
Black Magic
|
In order to verify that the texture coordinates are being written/read correctly I coded in something to view them. These are the first set of texture coordinates for the NVV hull 03. Something doesn't look right as they seem displaced a little to the right and down (things just don't line up right like the door below)
I took the texture coordinates and subtracted 0.5f from X and added 0.5f to Y to get to screen coordinates (rendered as transformed primitives - thus already specified in screen space). I rendered them to a surface where the surface is the diffuse texture for NVV hull 03. I then saved this texture to a graphics stream and used that stream as input into creating an new image. The new window's background image was set to this image. I had the TextureLoader class save the texture (and thus the rendered surfaced) to file so I could display it here. Anyone have any ideas why it seems displaced? |
12-31-11, 02:50 PM | #378 |
Black Magic
|
Okay figured out my problem. The problem was due to perspective projection of camera (and not setting the camera before rendering to surface!). To fix I rendered the texture to a full-screen quad and drew that, then I drew the texture coordinates. Since all of this was being rendered to a surface I had a perfect texture to display when it was done (I added some new buttons that allow you to view the texture coordinates for a mesh's diffuse or AO map):
I was also being stupid about how to render the texture coordinates. After sleeping on it I realized that since I'm using transformed (screen space) coordinates to render the texture coordinates I don't have to do anything but multiply the texture coordinates by the screen resolution (actually the render to surface dimensions since it's technically the screen during the rendering of them) You can change the color of the rendered texture coordinates via button. You can also save this image to file (double click anywhere in window - it will save as the type you have specified under the misc tab for screenshots). In the display window title bar is tells you the mesh name : the texture name (texture type) This window is resizable by using mouse like all other windows in windows (starting size is 600 X 600) I have noticed that some of the AO maps seem to be not correct. Looking at the NVV Hull 03 you can see some problems in it. Last edited by TheDarkWraith; 12-31-11 at 03:36 PM. |
12-31-11, 06:19 PM | #379 |
The Old Man
|
Could it be possible to Export Maps to Clipboard?
When working on skins it would be fantastic to have a layer showing where everything is located llike limber holes etc that is hidden prior to save. |
12-31-11, 06:58 PM | #380 | |
Black Magic
|
Quote:
Are you looking for something like a mask? Like an alpha layer? |
|
12-31-11, 08:22 PM | #381 | |
The Old Man
|
Quote:
Not sure if it is UV or AO Map but it is the map that shows what part of the texture image is being used. |
|
12-31-11, 08:55 PM | #382 | |
Black Magic
|
Quote:
I currently allow you to save the image shown though it's an app screenshot (it saves the whole window). The image is saved in whatever format is selected for screenshot under the misc tab. I could make it just save the rendered portion but then that would contain texture in it also. I guess I could add another button(s) - mask that would create 'masks' for the subsets. Ran into another problem: I currently coded the rendering of texture coordinates to allow you to render only the subsets shown (whatever subsets are checked in the meshes treeview for that mesh). It all works fine except for the second subset (if the mesh has more than 1 subset). The problem is those texture coordinates are outside the normal 0-1 boundary and I'm guessing they are supposed to wrap back around? I don't see where Granny defines a wrapping mode for the texture coordinates |
|
12-31-11, 09:21 PM | #383 |
Stowaway
Posts: n/a
Downloads:
Uploads:
|
int32 UVW Tiling
Materials::Extended data |
12-31-11, 10:10 PM | #384 |
Black Magic
|
I see says the blind man Now I have to play around with the different values to figure out what they mean.
@TheBeast: Something like this for the 'mask': There is no alpha encoding in this. Just what you see. I could probably code something to make the black transparent via the alpha channel. |
12-31-11, 10:43 PM | #385 | |
The Old Man
|
Quote:
Select the black color only of that layer and delete. You are left with just the green wireframe only allowing you to see layer(s) below to edit. Save all layers in .PDN for PaintDontNet or .PSD for Photo Shop for future editing. When you are ready to Save the texture, you simply hide that layer with the Wire Frame so it is not saved to finished image texture. |
|
12-31-11, 10:45 PM | #386 |
Black Magic
|
So it needs transparency or not? If I don't have to code in an alpha channel that would be great
|
12-31-11, 11:04 PM | #387 |
Black Magic
|
here's another question for everyone:
Usually texture coordinates are defined in the 0-1 range. You can exceed these ranges for special effects of if you want an image wrapped (values of 1+ and for every additional 1 after that cause x times wrapping). When I display the texture coordinates do you want them all in one screen (all values in one screen) or do you want them split between screens (values 0-1 in one screen, values 1-2 in another screen, values -1-0 in another screen, etc)? The splitting between windows would be like how Wings3D shows texture coordinates that are outside the 0-1 range |
01-01-12, 12:58 AM | #388 |
Black Magic
|
Let me show you the problems we face with these SH5 units:
NVV Hull03 subset 0: NVV hull 03 subset 1: I needed something visual to see what was going on with the texture coordinates. What you are seeing are the texture coordinates rendered based on their UV values. The UV values for X ranged from -1 to 9....yes 9!! (the AO maps are even worse) So you are seeing the same image tiled 10 times in the X direction and 10 times in the Y direction as the background that the texture coordinates were rendered on. Since subsets share the same texture coordinates that would be why subset 0 is still tiled 10 times in the X and Y directions. You may ask why did I have to tile the Y direction by the same amount as the X direction? To keep scale and so they were rendered correctly is why. Now can someone explain to me why you would need to take texture coordinates any higher than 2? I just don't get it This makes it rather difficult to show the texture coordinates on one 'page'. They have to be split up into multiple pages if one wanted to 'see' them Here's v1.0.492.0 if you want to see these texture coordinates for yourself: http://www.gamefront.com/files/21141...v1_0_492_0_zip Last edited by TheDarkWraith; 01-01-12 at 01:29 AM. |
01-01-12, 01:44 AM | #389 | |
The Old Man
|
Quote:
Once the texture has been added as layer the user can select global the background color that is not needed and delete it leaving wire frame in place. |
|
01-01-12, 02:39 AM | #390 | |
Stowaway
Posts: n/a
Downloads:
Uploads:
|
Quote:
Normally you correct this before sending it out to God knows where. Many consider it sloppy work not to adjust the UV's to a 0 - 1 layout. That does not seems to be the case more and more often now days. Hard to say if this (SH5 UV's) was a time constrant cause or oversight. |
|
|
|