SWBFGamers

Modding for the Original SWBF1 and SWBF2 => SWBF1 Modding Tutorials => Topic started by: Sereja on June 22, 2012, 06:58:42 AM

Title: Shiney Glass Ideas
Post by: Sereja on June 22, 2012, 06:58:42 AM
edit by buckler:  split from this topic:
http://www.swbfgamers.com/index.php?topic=4769.0

Wow, intersting explanation, tripider! So, what you think, is it possible, to somehow change this code, to make subject, be shiny and transparent in same time? I mean, realistic glass looks way, not just "04 00 00 00 04 04" ?
Title: Re: Shiney Glass Ideas
Post by: tirpider on June 22, 2012, 07:32:45 AM
That seems possible.
The only way to know is to try ;)

I know there are different types of transpearancy, but I am not sure what they mean, exactly.
0x04 (4) single sided transpearancy
0x08 (8) double sided transpearancy
0x10 (16) hard edged transpearancy

I am guessing glass would be a combination of an alpha channel in the TGA and either 04 04 or 08 04.

The link to the GT post has the most in depth list of flags and render types. It's all still being tested and verified.

The stock assets use these flags, of course.
Might look at a prop that has a simular look and see what it has after ATRB.
Title: Re: Shiney Glass Ideas
Post by: Sereja on June 22, 2012, 10:07:08 AM
Well, long time ago, I try, probably most of the possible number combinations of "mini line" code (04 00 00 00 04 04), but no one of them was looks like a glass. That's why I am almost sure: if the key to glass exist, it is lie somewhere deep, in my "extremely unusual" line code. But it is huge, and very hard to slice, without strong knowlege, of hex editing...
Title: Re: Shiney Glass Ideas
Post by: Led on June 22, 2012, 10:21:16 AM
Doesn't glass exist in certain mod maps (or even in a speeder windshield)?  Could the tga for that asset be examined for clues?
Title: Re: Shiney Glass Ideas
Post by: Sereja on June 22, 2012, 05:31:17 PM
As far, as I know, there is no exist realistic glass samples in SWBF assets. Some windows, or speeder windshield has easy code: 04 00 00 00 04 00, or 04 00 00 00 08 00, but it is only transparentness, without shiny. So those "glass" more looks like transparent paper, or something like this. If you wish to see, how a realistic glass may looks, you may look at droideka shield, but this is an effect, and can't be use for static .msh.
If you try to mix shiny and transparentness, in those "mini line" code, like this: 04 00 00 00 04 04, you will got ugly, and unrealistic result. So, I think my huge, "extremely unusual" code must be somehow edited, to make "mini line" code works correct.
Title: Re: Shiney Glass Ideas
Post by: tirpider on June 22, 2012, 05:46:44 PM
hmm.
The floors in the Death Star interior look pretty glass-like.
The have to be transpearant, because the 'reflection' is just another model under it.
Perhaps adjusting the diffuse/ambient (the first 32 bytes of your code) on them might make a nice glass?
Title: Re: Shiney Glass Ideas
Post by: Bamdur on June 22, 2012, 06:33:32 PM
For a  glass effect, one would should make a texture with solely an alpha channel that is transparent, apply that to the model and add the desired affect to the byte code. This would make it so the model has collision but you can see through it making the glass/transparent/invisible effect. Just restating this if it already hasn't been said.
Title: Re: Shiney Glass Ideas
Post by: Phobos on June 22, 2012, 07:24:21 PM
all_hover_combatspeeder_windshield
all_fly_snowspeeder_windscreen

heres 2 examples of translucent stock glass tgas. i dont know how to make them shiny (other than hex edits to msh i have not tried yet) but maybe a tga.option would work?
Title: Re: Shiney Glass Ideas
Post by: tirpider on June 22, 2012, 08:46:45 PM
The glass has me stuck.
alpha layers always mess me up.

btw.... Good Tutorial, Sleepkiller :)
You got right to the point and are very clear. I like that.
Title: Re: Shiney Glass Ideas
Post by: Sereja on June 23, 2012, 01:18:15 AM
Adding new, secondary texture, with different alpha channel cud be an interesting idea. I sow something similar, in some .msh models, the secondary texture, is usualy use for bumpmap. But to try this, I must have real XSI, and use Pandemic exporter...
Still, it is possible, exist another way, to add secondary texture: just put it inside, with hex editor. But I do not know, wich exactly part of the code, I must copy and paste.
Quote from: tirpider on June 22, 2012, 05:46:44 PM
The floors in the Death Star interior look pretty glass-like.
Sorry, but the reflection floors, it is usual transparent, with reflection regions. I must also say, the some codes, for SWBF2 isn't work for SWBF1, and I have to recode them, when converting my maps.
Quote from: Phobos on June 22, 2012, 07:24:21 PM
but maybe a tga.option would work?
Yes, it cud be nice, if .tga may have secondary alpha channel, and SWBF1 may recognize it, but I think, it is impossible.
Still, the .tga.options, is realy can have some connection to alpha channel. For example, if the .tga.option is incorrect, texture with alpha channel on shiny coded .msh, may look's ugly. For example, you may see this effect at some other modders converted maps, or sides: SWBF2 Darth Vader, aat commander, sky texture on Felucia and Degobah look's incorrect.
Title: Re: Shiney Glass Ideas
Post by: Unit 33 on June 23, 2012, 03:32:37 AM
Interesting... If you were to apply this to a Unit I wonder if it would work?
I was thinking specifically into incorporating it into the Disguise kit to make it appear like an invisibility cloak.
Title: Re: Shiney Glass Ideas
Post by: Led on June 23, 2012, 03:36:59 AM
Yes, it should work.  Sleepkiller made a head-only sniper for me.

See a few posts in on this topic:
http://www.swbfgamers.com/index.php?topic=3984.0

Title: Re: Shiney Glass Ideas
Post by: Unit 33 on June 23, 2012, 03:43:30 AM
Quote from: Buckler on June 23, 2012, 03:36:59 AM
Yes, it should work.  Sleepkiller made a head-only sniper for me.

See a few posts in on this topic:
http://www.swbfgamers.com/index.php?topic=3984.0

Oh yeah! I forgot about that!

[WeaponClass]
ClassLabel = "disguise"

[Properties]

IconTexture = "IMP_fusioncutter_icon"

Label = "Disguise Kit"

GeometryName = ""
RoundsPerClip = 0

AnimationBank = "tool"

DisguiseOwnerModel = ""


I suppose you just but the transparent model name under "Disguise Owner Model" then?

Title: Re: Shiney Glass Ideas
Post by: Led on June 23, 2012, 03:45:20 AM
I'm not sure, but I had heard that the disguise kit always uses the first unit skin on the other team.

So, I guess it may work if the first unit on the other team is transparent :P
Title: Re: Shiney Glass Ideas
Post by: Sereja on February 21, 2013, 03:29:17 AM
Well, here is my Glass Invention! :cheer::
[spoiler](https://www.swbfgamers.com/proxy.php?request=http%3A%2F%2Fi51.fastpic.ru%2Fbig%2F2013%2F0221%2Ffc%2Fc3c2156b611bdec994c6bafb425d70fc.jpg&hash=c1958c870e2e0300fae3c7cb5e573d534b949c89)[/spoiler]
As you may see, it has soft edged, double transparentness, and specularity!
And here the sample pic, of glow glass:
[spoiler](https://www.swbfgamers.com/proxy.php?request=http%3A%2F%2Fi53.fastpic.ru%2Fbig%2F2013%2F0221%2F81%2F1e1d7ea14e81d8e652791504c423a681.jpg&hash=d55f7dec11b7aacf6891cb125a2df38229204788)[/spoiler]

Here the glass hex code itself:
You have to put this after ATRB:
[spoiler]04 00 00 00 C0 04[/spoiler]
and for glow glass:
[spoiler]04 00 00 00 C1 04[/spoiler]
Sad issue: not works with bump.
Title: Re: Shiney Glass Ideas
Post by: RepComm on February 21, 2013, 09:40:32 AM
Holy frackin' crumpets sereja!!
That is really cool!

I like the second versions better, they look less like droideka's shield :P

Any chance you'll be adding new shiney windows to your maps in future?

Edit: And.. A new page.
Title: Re: Shiney Glass Ideas
Post by: Sereja on February 21, 2013, 10:04:39 AM
Quote from: -RepublicCommando- on February 21, 2013, 09:40:32 AM
Holy frackin' crumpets sereja!!
That is really cool!

I like the second versions better, they look less like droideka's shield :P

Any chance you'll be adding new shiney windows to your maps in future?

Edit: And.. A new page.
Thank's! :)
Sure, since I working at unfinished "Naboo: Ottoh Gungah" map, by the way, I was planing to make discovery, and invent glass. Now, it's done, and map will be maded in perfect condition, as it should be. Also, I am planing, to release my old maps, with "Special Edition". Custom sound, and new inventions, will be included...
A new page? ...:confused:
Title: Re: Shiney Glass Ideas
Post by: Unit 33 on February 21, 2013, 10:47:17 AM
Shinny windows.... Hey I know a place with lots of windows
(https://www.swbfgamers.com/proxy.php?request=http%3A%2F%2Fmassassi.hobby-site.com%2Fmassassi%2Fpictures%2Fepisode_5%2Fimg%2Fcloud_city_corridor01.jpg&hash=aee7485812fcfb704e584e2996c481374ebb252c)
...One day :'(
Title: Re: Shiney Glass Ideas
Post by: Phobos on February 21, 2013, 11:02:10 AM
Quote from: Sereja on February 21, 2013, 03:29:17 AM

Here the glass hex code itself:
You have to put this after ATRB:
04 00 00 00 C0 04
and for glow glass:
04 00 00 00 C1 04
Sad issue: not works with bump.

This is most certainly useful thanks. I wonder have you looked at what settings the ice caverns uses from Harbor?
Title: Re: Shiney Glass Ideas
Post by: Sereja on February 21, 2013, 11:28:41 AM
Quote from: Phobos on February 21, 2013, 11:02:10 AM
This is most certainly useful thanks. I wonder have you looked at what settings the ice caverns uses from Harbor?
Sure, but there is just a simple codes, with specularity, scroll, and transparent. They are not mixed, and each one of them, belonged to different textures. Still, most interesting of them - blur code:
Quote04 00 00 00 00 16
I am use it, for jedi ghosts, for my Dagobah map, but, with little upgrade:
04 00 00 00 09 16 - "09", make it to glow.
Title: Re: Shiney Glass Ideas
Post by: Phobos on February 21, 2013, 11:32:21 AM
Nice, I want the rodian to glow 'neon green' Ill try that code
Title: Re: Shiney Glass Ideas
Post by: Sereja on February 22, 2013, 06:29:36 AM
Sereja's Glass Tutorial.

Well, after some researches, and testings, I made a new discovery!
I am exploring a code, that tripider try to "fix", and I, figure out how it works, and actualy it's real purpose.
The code, named "Additive Soft Edged Transparence" looks like this:
04 00 00 00 40 00
My "Glass Code", look's like this:
04 00 00 00 C0 04
But I figure out, that "40" and "C0", actualy, do the same, so, my "Glass Code", actualy may works in many variations:
04 00 00 00 40 04
04 00 00 00 C0 04
04 00 00 00 D0 04
04 00 00 00 E0 04
04 00 00 00 F0 04

So, the "Glass", it's actualy an "Additive Soft Edged Transparence" + "Specularity".
And "Glow Glass", it's an "Additive Soft Edged Transparence" + "Glow"  + "Specularity".

But for understanding "Glass", HEX editor codes, is far not enough...
Why, if you try just mix "Transparence" & "Specularity", you surely got some "buggy" model? The answer is simple: those effects, both, using an alpha channel, and if using the same texture, with single alpha channel, start fighting for it, because each effect needed separated parameters and they can not be shared.
So, that what "Additive Soft Edged Transparence" do: it is stopping use an alpha channel, and left it, for "Specularity"!
So, try guess, how it regulate it's own transparence parameters?...
That's right! By tga RGB color palette! It work's simple:
0, 0, 0 = totaly transparent glass.
255, 255, 255 = totaly non transparent glass.
[spoiler](https://www.swbfgamers.com/proxy.php?request=http%3A%2F%2Fi52.fastpic.ru%2Fbig%2F2013%2F0222%2F1d%2F1527605238c16dc9510fe124e9695a1d.jpg&hash=f3e766f04364aae4793bed274aa206ea8f6cbce1)[/spoiler]
But if it use tga RGB "pic", instead alpha channel, now, how it  may got it's own colors?
Remember: it's an Additive Transparence, so, it used added colors, from your .SKY ambient parameters, like this:
AmbientColor(40, 36, 76);
So, now everything on right places:
alpha channel for specularity;
tga RGB palette for transparence;
SKY Ambient Color for colors;

Happy moddyng with glass!

-Edit:
Funny Speculation:
Behold!
Bump, mixed with Specularity (Glass), for SWBF1!
[spoiler](https://www.swbfgamers.com/proxy.php?request=http%3A%2F%2Fi53.fastpic.ru%2Fbig%2F2013%2F0224%2F3d%2Fdf3b755ecb8e86f50b6492fdfa32123d.jpg&hash=66671180af7f08f8090f6bd7ea78fa9f3cfa38db)[/spoiler]

[spoiler]Well, unfortunately, it is realy impossible to be done, and I am cheating a little bit :P.[/spoiler]
EhPortal 1.34 © 2024, WebDev