View Full Version : [REL] Working glass and transparency
Belgabor
01-26-2008, 06:57 PM
As examplified by CSFs and Vodhins (re)releases today, it is finally possible to create glass and transparency without X-ray effect. The program you need to do this is ovlmake, which I originally wrote to replace ovlcompiler.
Before get into the details, the disclaimer:
I release ovlmake to enable glass and transparency, not for animated CS. Of course it can be used for that, but the ban of pming me or others uninvited about animating CS stays in effect!
Furthermore you are required to read the included readme files, any qustions that are answered there (or solved by a simple google query) will be ignored in this thread.
Now that's out of my hair, here is the introductory part of the readme for this issue (no need to repeat myself :p):
After a very long time I now found out how to do proper transparency and, as far as possible, got rid of the X-ray effect. By "as far as possible" I mean that after lots of experiments I came to the conclusion that for some objects you cannot fully prevent X-ray (even some original game objects show X-ray if you look closely). Still I think that the X-ray left is a lot less severe than before, it seems to only affect the object itself and then (probably) only parts of the same mesh. It also seems to occur mostly looking at the object from the left, provided you didn't rotate it. Left is in relation from your original view when you start a sandbox (ie looking at the entrace from insed the park.
As to when this X-ray occurs I can give no good explanation. In general I'd say the more complex the object is, the likelier it is to occur. It may also include some unknown voodoo. If your object shows it, I've provided a few customization options that may help or not. To understand them, I first need to explain how proper transparency in RCT3 works.
Meshes are stored in OVLs in two data chunks, one contains a list of all the vertices and the other the faces (triangles) as three indices into the vertex list. For transparent objects (geomobj tags in ovlcompiler xml files with placing texture or glass / importer scn files with meshes set to placing Texture Only or Unknown), the ovl file stores the face list three times, each one sorted along one axis. Now the crux is how the faces need to be sorted. From original ovls it seems to me that only the lowest coordinate (in the sorted direction) of the triangle matters.
Still I have implemented several sorting algorithms that take other things into account.
More details, including a brief howto for people not used to command line utilities can be found in the readme.
Update:
After looking at all meshes of RCT3 (Vanilla + Soaked + Wild, thats ~43100 meshes) I can now tell you that there is a 100.00% correlation between the used Texture Style and the setting that is currently named 'Placing' in the importer:
SIAlphaMask... uses "Texture Only"
Other SIAlpha..., SIGlass and SIWater use "Unknown"
All others use "Texture & Mesh"
Download here:
http://sourceforge.net/project/showfiles.php?group_id=181524&package_id=254162
LightGrenades
01-26-2008, 07:00 PM
Is the animated feature on here a bit easier than the compiler?
I understand the compiler, but it is too tedious to use everytime.
ANYWAY, thanks for this. You're one of the few who are singlehandedly keeping this game alive.
Belgabor
01-26-2008, 07:03 PM
No, not really. But it works more reliably (ie no unexpected crashes lately). A few things are a tiny bit easier, but mostly it's the same.
But for glass/transparency that doesn't need to concern you :)
Adnecles
01-26-2008, 07:21 PM
Thank you belgabor for your time and patience for all the coding to make better glass and animation. Whatever are you going to do now?....
now I can finally make my window/walls and look somewhat good.
DasMatze
01-26-2008, 07:28 PM
Thank you thank you thank you! It works fine! :)
DasMatze
coinich
01-26-2008, 08:13 PM
Excellent, thanks. I'm gonna treat this with a bit of care before I go fixing everything in sight, but thanks. It WILL be used.
BigBurger
01-27-2008, 08:51 AM
Hm, sounds quite easy. :) Very well done, Belgabor. It even works without "fixing".
-BigBurger
Vodhin
01-27-2008, 12:01 PM
I'm not sure if other 3-D Modeling Programs have this, but MilkShape has an option to "Draw Backfaces" in the 3D view of your model (which is on by default). If you turn this option off (Right click the 3D viewport, un-check Draw Backfaces) then you can get a better idea of how your model will come out in RCT3. MilkShape can process Alpha Transparancies if you use PNG texture Files, and the 3D preview is nearly identical to what you'll see in RCT3 as far as transparancy. For best results, in your 3D view set your Transparancy setting (right click 3D view) to Depth Sorted Triangles, and Set Alpha Reference to about 0.5 or 0.6
Here's the thing I've noticed Transparent objects- not a flat plane such as what might be used for a window - might need a duplication trick in order for you to be able to see the inside of an object through itself:
Let's say you wanted to make a cube of glass. You make a cube and apply your semi-transparent texture to it. If you have not turned off draw backfaces, then it looks great from at most 3 sides. From other sides the inside seems to disapper, just like the X-Ray effect.
The reason is that each face is drawn in some kind of sequence, and that sequence determins what's visible: objects drawn before the face you are looking through can be seen while objects drawn after the face cannot. It's a simple idea, really. in order for the face to "know what's beyond it," the "what's beyond it" needs to be "there" before the face is rendered.
So back to our cube. As is the new OVLMake should make a perfectly transparent object in the game, you should be able to see other sthings beyont it at all times. However, let's say that you set it up as Double Sided, so you should see the inside. Well, you should get the same problem as in the modeling program- some angles dont work.
To solve the issue, thing one sidedly You cannot see the inside from some angles because of the draw sequence. Making a second cube (duplicate the first, actually) and "turning it inside-out" (Reverse Vertex Order in MilkShape)should solve the problem. But not right away,
If you have the 3D view set to Draw Backfaces still, then uncheck that uption to only show the faces as single sided. Whoops- that duplicate, inside out cube dissappears. That's because the new "Group" ("Duplicate" mesh) needs to be moved up in the group list, so the new Duplicate "inside" mesh is drawn before the original "Outside" mesh. You'll need to import them as 2 seperate meshes, each set as single sided.
A side note: do not weld verticies between meshes- if you were making a sphere, you would need to be sure not to weld the inside sphere to the verticies of the outside sphere. the results of the shared verticies will cause very strange shadings, and will probably increase chances of X-Ray effect. Simply hide the inside or outside meshes while welding the others.
That should do it. You should now have a complex mesh that's visible inside and out. But if you really wanted to be certain, take the inside mesh and turn it upside down (bottom is on top) and face it backwards (front is not in back). I don't think this last step is needed as Belgabor's program should sort out the meshes properly now.
Now the above cube may still exhibit X-ray effect for other objects. I would play with welded verticies versus non welded verticies, as well as orientation in the modeling program - sometimes just turning the object around 90 or 180 degrees fixes everything...
Have fun :D
Belgabor
02-04-2008, 05:55 PM
Small information update. See first post.
Vodhin
02-04-2008, 09:51 PM
Update:
After looking at all meshes of RCT3 (Vanilla + Soaked + Wild, thats ~43100 meshes) I can now tell you that there is a 100.00% correlation between the used Texture Style and the setting that is currently named 'Placing' in the importer:
SIAlphaMask... uses "Texture Only"
Other SIAlpha..., SIGlass and SIWater use "Unknown"
All others use "Texture & Mesh"
Ok, if this is so... then it's time to simplify the importer- remove the option and shorten the settings needed, and make the importer set these automatically? An advanced mode might be good to have, too, where the settings are available to change if one really wants to....
CoasterSim.Fan
02-05-2008, 01:20 AM
Maybe leave the importer UI alone but have them set automatically.
Belgabor
02-05-2008, 02:02 AM
I already set them automatically. The UI had a minor modification, moved the column to the far right so you can better ignore it =).
callmecosmo
02-05-2008, 03:05 PM
Belgabor, a big thank you for all your behind the scenes work with the importer that makes all the custom CS possible. We all owe you a standing ovation.
-eezee-
02-06-2008, 07:48 AM
Thank you. Works fine. Now I can update my sets with real glass.
Would it be possible to incorporate it into the importer? That would be alot more comfortable.
Belgabor
02-06-2008, 08:18 AM
It's a command line program =) Normally you would start it from a dosbox (cmd.exe), but for simple tasks you can drag'n'drop your scn file on the exe in the explorer. Take a look at the readme.
StarBP
10-19-2008, 10:37 PM
Sorry to revive an old thread, but can't that functionality just be added to the Importer? If something can be added to ovlmake, then surely it can be added to the OVL maker in the RCT3 Importer.
Vodhin
10-20-2008, 03:01 AM
It has been. Get the latest importer (it still in beta, though, so it's not "official") http://sourceforge.net/project/showfiles.php?group_id=181524
Imagineer125
11-04-2008, 02:10 PM
hey mine dose not work it comes up and goes away ????
wabigbear
11-04-2008, 02:39 PM
hey mine dose not work it comes up and goes away ????
Did you read the "Read Me" file that was included?
Imagineer125
11-04-2008, 03:22 PM
yes i did
RCT3robin
11-04-2008, 04:00 PM
Did you Get exactly what the read-me says?
Imagineer125
11-04-2008, 04:04 PM
ok tell me how to did it cuz i read it ok tell how you download and stuff on your cumputer cuz mine wont work or im doing something worng
wabigbear
11-04-2008, 04:55 PM
What is it that you are trying to do with the Ovlmake?
Imagineer125
11-04-2008, 05:30 PM
what are you talking about
RCT3robin
11-04-2008, 05:41 PM
He means what are u trying to make with the ovlmake? ( dont say the ovls , Because we know that ;))
Imagineer125
11-04-2008, 05:47 PM
i cant even open it i click the ovlmake that i downloaded and a black box comes up and goes away very fast
tycoon4life
11-04-2008, 05:56 PM
You have to open it with the command prompt.
Imagineer125
11-04-2008, 05:58 PM
oh i will try it
Imagineer125
11-04-2008, 06:02 PM
where the command prompt. tell me what to do ok i downloaded it theres a file ovl make thats the name open the folder and it has read mes in it it has the magic thing and there a thing looks like a program it say ovlmake i click it and a black box comes up and gose away
freesz
11-04-2008, 06:11 PM
first of all stop double posting..
Imagineer125
11-04-2008, 06:13 PM
omg sorry im new so where the command prompt. and how do i make the ovlmake work i want to use it
RCT3robin
11-04-2008, 06:16 PM
if you cant even open the ovlmake , animating will be a hell?-.-
I advise you waiting for The xml maker X Enterprising is making, It won't be long before the release.
Imagineer125
11-04-2008, 06:26 PM
i dont get it what did you do to make it work what is the command prompt.
X Enterprises
11-04-2008, 10:40 PM
Command Prompt is run by going to Start->Run... and typing "cmd" (without quotes). It will open the text based command prompt. I will not explain further on how to run OVLmake because if you are having problems with starting command prompt, then i doubt you'd be able to animate anything.
Command prompt is basically for running programs with options to it and preforming various other functions for the computer.
Now, my XML maker will have a compile feature with it (no having to use command prompt) but you still have to have basic knowledge of OVLmake. So I guess you won't be able to use it.
Besides, have you even imported any cs?
Imagineer125
11-05-2008, 07:54 PM
yes i have why and its i made the ovlmake work i hade somehting block so now it works yea
X Enterprises
11-06-2008, 01:33 AM
I'm sorry, I can't understand your reply.
yes i have why and its i made the ovlmake work i hade somehting block so now it works yea"yes i have why and its" looks like a bunch of random words.:bulb:
I'm guessing you're saying "yes i have" imported CS.
"and its i made the ovlmake work" Well, that's good you made it work.
Your sentence structure is hard to understand.
But anyway, have you any experience with XML? Have you made a suitable model? I think you may be ahead of yourself here. But oh well, do what you want.:rolleyes:
Imagineer125
11-06-2008, 10:41 PM
well im made cs and put it in the game well i want to animate to make A CFR and i already have my model for to animate and sorry i type fast and mess up alot lol so yea
vBulletin® v3.7.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.