Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Models and Media / Need help using bond1's new shaders on the migration-upgraded sci-fi stock media and still keeping the glowing bits

Author
Message
Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 14th Aug 2010 15:29
Oi, long title . Anyway, I tried asking bond1 (several times) about this, but he's been too busy to respond. I'm trying to use his normal/spec map shaders on the sci-fi stock media and still have the neat glowing bits and bobs added in v1.17 to still work. This probably requires editing the shader in some way, but I can't figure out how exactly. Any ideas? It's been bugging me for quite some time as I need it for one of my projects (+ it would be really nice for the rest of the community in the long run).

Nbt
15
Years of Service
User Offline
Joined: 11th Oct 2009
Location: Behind you!!
Posted: 14th Aug 2010 15:43
You do know that quite a few of the new shaders used in 1.17 and beyond are in fact made by bond1 ??

As to bond's shaders he tends to place the illumination map (_I texture/self illumination) in the alpha channel of the spec map (_S texture) for his wall shaders from what I could see??

Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 14th Aug 2010 15:50
Yeah, I knew that he did. He posted a demo video on his YouTube page before the betas started

Anyway, do his Normal/Spec map shaders support said illumination map?

Nbt
15
Years of Service
User Offline
Joined: 11th Oct 2009
Location: Behind you!!
Posted: 14th Aug 2010 16:18
Bond1 is generally very good at commenting his shaders to tell the user what they do and how they do it, so maybe open up the one you want to use and have a little read ??

I'm sorry I'm not much help, but I really am a nub and know less than nothing about most FPSC related stuff

vortech
15
Years of Service
User Offline
Joined: 18th Mar 2010
Location: Finland
Posted: 14th Aug 2010 21:41
Your have to edit speclura map that's calles texture_I.dds(or something) Whiter parts are brighter and darker are darker. Easy. Now edit to your want's but remember that it must be seamless and it should fit onto texture.


Check for pure horror.
Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 15th Aug 2010 02:17
Um.... I don't quite think that's exactly the effect I wanted, but I'll try it tonight. If that's how the glow effect works in the migration shader, the spec map should already be rigged for that. I thought it was some sort of line in the shader that used an illuminant map and that I'd need to add that part to the "new" shader, add a normal map and use the existing specular map... but again, I'll try tonight.

Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 16th Aug 2010 16:51
I still got nothing... any other ideas?

bond1
19
Years of Service
User Offline
Joined: 27th Oct 2005
Location:
Posted: 16th Aug 2010 20:02 Edited at: 16th Aug 2010 20:10
If you wish to add a self-illumination component to my SEGMENT normal mapping shader then change the last line of the pixel shader portion to:

float4 result = diffuseContrib + (SpecAmount*specContrib) +(0.1*lightmap*diffuse) +(AmbiColor*diffuse) +effectmap.w;

This will use the ALPHA channel of the specular map for self-illumination (glow). Keep in mind that you may have to alter the specular textures to account for this, but it's a trivial task to copy the illumination texture to the alpha channel and resave.

Remember to save the texture in .dds DXT5 format to retain the alpha channel. And also, if you use this shader variation the specmap MUST contain an alpha channel or it will default to white, in which case the entire texture will glow.

----------------------------------------
"bond1 - You see this name, you think dirty."
Nbt
15
Years of Service
User Offline
Joined: 11th Oct 2009
Location: Behind you!!
Posted: 16th Aug 2010 20:21
Quote: "but it's a trivial task to copy the illumination texture to the alpha channel and resave."

Unless you use Paint.Net

bond1
19
Years of Service
User Offline
Joined: 27th Oct 2005
Location:
Posted: 16th Aug 2010 23:37
Paint.net doesn't support alpha channels? Wow, does GIMP? It's 2010, I would have thought any mainstream image editing program could deal with alpha channels nowadays - it's such a fundamental way of storing and masking image information.

----------------------------------------
"bond1 - You see this name, you think dirty."
Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 16th Aug 2010 23:48 Edited at: 16th Aug 2010 23:48
I think Gimp does I use Photoshop CS4 (I need to buy CS5) but I sometimes use Gimp for touch-ups. Gimp just does some things better, but... well, what can I say? I have Photoshop

bond1
19
Years of Service
User Offline
Joined: 27th Oct 2005
Location:
Posted: 16th Aug 2010 23:51 Edited at: 16th Aug 2010 23:52
I use CS4 too, so it's just a matter of hitting ctrl-a to select all pixels in the illumination map and pasting it into the alpha channel of the spec map, then resaving the specmap texture with Nvidia's dds plugin in DXT5 format.

Ten second task per texture.

----------------------------------------
"bond1 - You see this name, you think dirty."
Nbt
15
Years of Service
User Offline
Joined: 11th Oct 2009
Location: Behind you!!
Posted: 17th Aug 2010 00:28
Paint.Net supports alpha channels and does all the .dds formats (DX1/3/5 etc) without any need for plugins. It just don't let you access the alpha channel as a separate entity to add or edit it etc

I can access the alpha channel add stuff into it and edit it etc with DXTBmp, it just won't save out the resulting DXT5 correctly and just ends up with just the alpha channel

I got Gimp, but find it cluttered and can't afford PS and refuse to pirate it, so will muddle on until I find a way

bond1
19
Years of Service
User Offline
Joined: 27th Oct 2005
Location:
Posted: 17th Aug 2010 01:02
Photoshop Elements is only $69, and has most of the basic functionality as Photoshop. And as far as I know, can also load photoshop plugins. Might be a good alternative. You could download the demo and try it out.

----------------------------------------
"bond1 - You see this name, you think dirty."
Nbt
15
Years of Service
User Offline
Joined: 11th Oct 2009
Location: Behind you!!
Posted: 17th Aug 2010 01:12 Edited at: 17th Aug 2010 01:16
I will take a look bond1, thanks for the info

edit: It looks a bit simplified like a handholding editor.
Anyway which version should get 7 or 8?? as 7 is only £20 and 8 is £50

bond1
19
Years of Service
User Offline
Joined: 27th Oct 2005
Location:
Posted: 17th Aug 2010 01:16
Yep on the Adobe forums, I got confirmation that Photoshop Elements supports alpha channels as well as the Nvidia DDS plugins.

I would think this would be a fantastic alternative for people who don't like GIMP, or would rather stick to more of an industry standard program. It has almost all of the main features of Photoshop minus some of the more esoteric features aimed more at photographers. Right now it's on sale for $69, so again it might be worth the time to check out the demo.

----------------------------------------
"bond1 - You see this name, you think dirty."
bond1
19
Years of Service
User Offline
Joined: 27th Oct 2005
Location:
Posted: 17th Aug 2010 01:38
Quote: "Anyway which version should get 7 or 8?? as 7 is only £20 and 8 is £50"


Not sure if there's any huge difference, but I'd definitely spend an evening or two with the demo to make sure it does everything you want it to.

Also, install the 32-bit version if it gives you a choice - the Nvidia plugins don't work with 64-bit photoshop.

----------------------------------------
"bond1 - You see this name, you think dirty."
Nbt
15
Years of Service
User Offline
Joined: 11th Oct 2009
Location: Behind you!!
Posted: 17th Aug 2010 01:49
I still use 32bit XP pro, so no worries of using the 64bit version

PW Productions
16
Years of Service
User Offline
Joined: 13th Mar 2009
Location: sitting in a chair.
Posted: 17th Aug 2010 08:05
I have Elements 5.0 from quite a while ago, yet I still use it to this date and am quite happy with it. It supports basically all PS plugins, such as nVidia plugins But I highly recommend getting a higher version above Elements 7 at the very least. If you can, shoot for CS5.


If something is perfect, it probably doesn't work. -PWP
mindragon
15
Years of Service
User Offline
Joined: 3rd Jan 2010
Location: Sweden
Posted: 17th Aug 2010 08:36
I´m a novice GIMP user, so I just checked the documentation for GIMP, and it does support alpha channels (and DXT5 export). It also lets you separate the channels so you can work directly with the alpha channel.

At least, that´s how I understand this section:
http://docs.gimp.org/2.6/en/gimp-channel-dialog.html
Kravenwolf
16
Years of Service
User Offline
Joined: 14th Apr 2009
Location: Silent Hill
Posted: 17th Aug 2010 08:44
Quote: "Paint.net doesn't support alpha channels? Wow, does GIMP? It's 2010"


Yep;













Kravenwolf

bond1
19
Years of Service
User Offline
Joined: 27th Oct 2005
Location:
Posted: 17th Aug 2010 09:09
Thanks Kravenwolf, I'm sure this is going to help a lot of people.

Adding an alpha channel in GIMP looks just as easy and straightforward as photoshop. And it's free.

----------------------------------------
"bond1 - You see this name, you think dirty."
Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 18th Aug 2010 00:39
At any rate, I'll be trying to set up the shader later tonight and I'll let you all know how it turns out.

If I didn't say it already, thanks again bond1 and everyone, it's a major help

Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 3rd Sep 2010 13:49
@bond1: I can't seem to find the "pixel shader portion" I tried to find it myself, but after 17 days... I got nothing Any help?

Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 8th Sep 2010 16:42
Not trying to bump so much, but I still need help. Are you still reading this, bond1?

bond1
19
Years of Service
User Offline
Joined: 27th Oct 2005
Location:
Posted: 8th Sep 2010 19:36 Edited at: 8th Sep 2010 19:37
Open norm_spec_tangentbasis.fx in notepad. Near the bottom find the final lighting equation, it will look like this:

float4 result = diffuseContrib + (SpecAmount*specContrib) +(0.1*lightmap*diffuse) +(AmbiColor*diffuse);

REPLACE it with this to add self illumination to the segment normal mapping shader:

float4 result = diffuseContrib + (SpecAmount*specContrib) +(0.1*lightmap*diffuse) +(AmbiColor*diffuse) +effectmap.w;

The self-illumination will be controlled by the ALPHA channel of the segments specular map (mysegmenttexture_I.dds for this particular shader).

----------------------------------------
"bond1 - You see this name, you think dirty."
Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 10th Sep 2010 12:01
I can't seem to find float4 result = diffuseContrib + (SpecAmount*specContrib) +(0.1*lightmap*diffuse) +(AmbiColor*diffuse); There are things like it, but none have +(AmbiColor*diffuse);

bond1
19
Years of Service
User Offline
Joined: 27th Oct 2005
Location:
Posted: 13th Sep 2010 17:20 Edited at: 13th Sep 2010 17:22
Oh ok, in the final version of this shader I combined the Ambient light contribution into the diffuse light contribution - in any case find the final lighting equation where it says "float4 result" and add " + effectmap.w" to the end of the equation followed by a semicolon. This would be the line right above "return result". I recommend doing this in DarkShader and then right clicking and select "compile" to make sure you don't have any errors.

----------------------------------------
"bond1 - You see this name, you think dirty."
Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 21st Sep 2010 03:34
I feel so stupid for asking all these questions, but this time it kinda worked, but I keep getting this weird glitch on both tests and builds. Any ideas bond1?

Attachments

Login to view attachments
Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 26th Sep 2010 07:30
Any ideas as to what's going on with that? I'm really confused

bond1
19
Years of Service
User Offline
Joined: 27th Oct 2005
Location:
Posted: 27th Sep 2010 02:39 Edited at: 27th Sep 2010 02:40
Just so we're on the same page, zip up one of the segments along with it's textures you are trying to get this to work on, and email it to me, along with the shader you've modified.

----------------------------------------
"bond1 - You see this name, you think dirty."
Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 2nd Oct 2010 14:35
Did you manage to figure out what I did wrong yet?

SOLO DESIGN
16
Years of Service
User Offline
Joined: 30th Jul 2008
Location:
Posted: 3rd Oct 2010 01:20
bond1 I have tried this in Dark Shader following your code to the letter and I get no errors when compiled but it makes the output pure white in dark shader..........???

Any ideas?

Regards
Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 7th Oct 2010 10:10
Not trying to pester, but did you get my e-mail, bond1?

SOLO DESIGN
16
Years of Service
User Offline
Joined: 30th Jul 2008
Location:
Posted: 8th Oct 2010 03:28
OK I have now got self illuminating segments, but I now have an issue with the segments that are not using a self illumination item on them.


To explain I have one segment of a wall with a cross on it the cross is glowing and uses the self illumination shader that bond1 said to change the shader to ( + effectmap.w; at the end of the shader code) all works well.

But if I put another segment that has no cross and glowing parts next to the segment above it looks very patchy and you can see where one segment stops and another begins as if the glowing segment is highlighted and the other is not.


How can I have self illumination on segments but not the highlighted segment issue I have above?

I thought only the alpha channel showing the white parts would glow and the rest would be normal......


Any ideas???

Wraith Staff have you had any success??
Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 8th Oct 2010 09:39
Nope, I still get that weird black sheen on everything I sent him the files like he asked, but he must still be busy and hasn't gotten around to them yet

SOLO DESIGN
16
Years of Service
User Offline
Joined: 30th Jul 2008
Location:
Posted: 8th Oct 2010 12:40
WRAITH STAFF - I had that when I had S textures and I textures.
I deleted the S texture(you do not need both) and used alpha on I texture. But I still get a weird block look next to a segment with no highlights on it.

Will keep working on this though as I really need this function for my game.....

Good luck!
Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 8th Oct 2010 13:30
@SOLO DESIGN: You need to keep the S texture. You copy the I texture and use it as the alpha of the S texture, not the other way around.

Maybe I need to delete my I texture as I still have both of them.

Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 11th Oct 2010 03:54
I tried my idea, but then I got this (Attached) It works perfectly on the dark parts of the wall, but I have no clue what's with the light parts. I got nothing

Attachments

Login to view attachments
SOLO DESIGN
16
Years of Service
User Offline
Joined: 30th Jul 2008
Location:
Posted: 11th Oct 2010 10:33
Yup! same as me....

I am thinking of creating a single pixel of white on the alpha of the non lit segments as I think it is a shader issue needing an alpha with data in it. It would mean a glowing x1 pixel but I may be able to live with that.
Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 13th Oct 2010 07:58
I wonder if that will work

Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 17th Oct 2010 18:39
@Bond1: Again, Not trying to pester, but did you ever get my e-mail? If so, did you figure out what we're doing wrong?

Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 26th Oct 2010 02:09
Did you figure anything out Solo? I haven't heard anything from bond1 after he wanted me to send him my stuff. It's perplexing. I just really need to figure this out and I just can't do it alone I don't want to have to keep bumping this, but it's crucial to my project

bond1
19
Years of Service
User Offline
Joined: 27th Oct 2005
Location:
Posted: 26th Oct 2010 08:45
Quote: "Not trying to pester, but did you ever get my e-mail? If so, did you figure out what we're doing wrong?"


I'm so sorry to leave you hanging. I've been in a funk lately, and on top of that I've been trying to catch up on some real-life tasks that have been piling up on me for quite a while.

I do have your email, and I will look at this week.

----------------------------------------
"bond1 - You see this name, you think dirty."
Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 26th Oct 2010 11:27
Thanks a lot for getting back to me! I completely understand... I just thought you'd abandoned my question Hope you can figure something out, 'cuz I'm stumped

bond1
19
Years of Service
User Offline
Joined: 27th Oct 2005
Location:
Posted: 31st Oct 2010 00:33 Edited at: 31st Oct 2010 00:40
Well I got it working, here a screenshot. The problem is the MULTIMESH mode in the stock segments pulling alternate textures. I suggest not altering existing segment FPS files, but instead create your own using the OFFICIAL segment maker to generate clean segment files.



----------------------------------------
"bond1 - You see this name, you think dirty."
bond1
19
Years of Service
User Offline
Joined: 27th Oct 2005
Location:
Posted: 31st Oct 2010 00:36
Here is the shader and textures to use as a template to make your own. Again, generate NEW segment fps files for new segments you want to create that uses this customized version of the shader. And also a "best practice" thing, keep this shader in a "ps_3_0" folder to differentiate it from ps2 shaders.

Zip file attached.

----------------------------------------
"bond1 - You see this name, you think dirty."

Attachments

Login to view attachments
Wraith Staff
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: Hamilton, OH
Posted: 31st Oct 2010 01:28
Thank you sooo much You have no clue how much I needed a way to do this. Now I need to go and work on re-making most of the scifi segments + their new spec/illuminate maps. I have a lot of work ahead of me, but it's well worth it Thanks

SOLO DESIGN
16
Years of Service
User Offline
Joined: 30th Jul 2008
Location:
Posted: 1st Nov 2010 12:58
Great!!! we now have illumination shader with normal mapping!!
Good stuff Bond1

Login to post a reply

Server time is: 2025-06-04 00:50:50
Your offset time is: 2025-06-04 00:50:50