SWBFGamers

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

Title: Shiney Glass Ideas
Post by: Sereja on June 22, 2012, 07: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, 08: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, 11: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, 11: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, 06: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, 06: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, 07: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, 08: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, 09: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, 02: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.
 
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.
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, 04: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, 04: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, 04:43:30 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!

Code: [Select]
[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, 04: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, 05:29:17 AM
Well, here is my Glass Invention! :cheer::
Spoiler (click to show/hide)
As you may see, it has soft edged, double transparentness, and specularity!
And here the sample pic, of glow glass:
Spoiler (click to show/hide)

Here the glass hex code itself:
You have to put this after ATRB:
Spoiler (click to show/hide)
and for glow glass:
Spoiler (click to show/hide)
Sad issue: not works with bump.
Title: Re: Shiney Glass Ideas
Post by: RepComm on February 21, 2013, 11: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, 12:04:39 PM
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, 12:47:17 PM
Shinny windows.... Hey I know a place with lots of windows
(http://massassi.hobby-site.com/massassi/pictures/episode_5/img/cloud_city_corridor01.jpg)
...One day :'(
Title: Re: Shiney Glass Ideas
Post by: Phobos on February 21, 2013, 01:02:10 PM

Here the glass hex code itself:
You have to put this after ATRB:
Code: [Select]
04 00 00 00 C0 04and for glow glass:
Code: [Select]
04 00 00 00 C1 04Sad 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, 01:28:41 PM
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:
Quote
04 00 00 00 00 16
I am use it, for jedi ghosts, for my Dagobah map, but, with little upgrade:
Code: [Select]
04 00 00 00 09 16 - "09", make it to glow.
Title: Re: Shiney Glass Ideas
Post by: Phobos on February 21, 2013, 01:32:21 PM
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, 08: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:
Code: [Select]
04 00 00 00 40 00My "Glass Code", look's like this:
Code: [Select]
04 00 00 00 C0 04But I figure out, that "40" and "C0", actualy, do the same, so, my "Glass Code", actualy may works in many variations:
Code: [Select]
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 (click to show/hide)
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:
Code: [Select]
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 (click to show/hide)

Spoiler (click to show/hide)