lfnetwork.com mark read register faq members calendar

Thread: Advanced light-based shading
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 06-20-2008, 10:59 AM   #1
haravikk
 
Join Date: Nov 2002
Posts: 11
Advanced light-based shading

Right, so far I've made a skin, and have applied a shader to one of it's textures. However, what I'd now like to do is apply an additional layer which is blended with the lighting on the skin.

It's a difficult one to explain, so let's suppose:
- My player model is a cube (not really!)
- I have a texture which is a simple gradient, applied to the whole cube.

What I want therefore is:
- The darker the side of the cube is, the MORE the texture is visible
- The lighter the side of the cube is, the more faded the texture is

Thus, if the texture is being applied to a 100% dark area of the cube, then that area of the cube will have the full texture applied to it.
If the texture is being applied to a 100% light side on the cube, then the texture should be completely washed-out/white.
If the texture is being applied to a 50% light side of the cube then the texture will appear partly washed out (50% white, 50% texture).

Is this even possible? The concept behind this is that shaded areas of the texture should appear darker when in shadow, but should disappear completely when in the light. Is there any way to gain access to the lighting being applied to a texture at any given point when it is applied to a player-model, or is this completely impossible?

Another way to think of it is that what I want is for the texture to have more contrast the darker it is, and less contrast the lighter it is. Can I do this with a shader?

Also, a slight aside but not really deserving it's own topic; is it possible to apply a texture such that it is dependent on the user's view-point? E.g so I can apply a texture more to an area the user is looking directly at?
haravikk is offline   you may: quote & reply,
Old 06-20-2008, 11:05 AM   #2
Inyri
The Magical Malefactor
 
Inyri's Avatar
 
Join Date: Sep 2004
Location: Chicago
Posts: 2,505
Current Game: Mass Effect 3
Veteran Modder Forum Veteran Helpful! Contest winner - Fan Fiction 
If you create a specular map with less contrast you can probably achieve this with a simple specularity shader. You can find these shader types in many many mods if you don't know off-hand how to create one.

Inyri is offline   you may: quote & reply,
Old 06-20-2008, 11:36 AM   #3
haravikk
 
Join Date: Nov 2002
Posts: 11
Do you know any mods off-hand I should search for?
haravikk is offline   you may: quote & reply,
Old 06-20-2008, 12:07 PM   #4
Inyri
The Magical Malefactor
 
Inyri's Avatar
 
Join Date: Sep 2004
Location: Chicago
Posts: 2,505
Current Game: Mass Effect 3
Veteran Modder Forum Veteran Helpful! Contest winner - Fan Fiction 
If you search on JK3Files for 'specularity' in the description, I had a tendency to specifically mention when a mod had it. I don't claim to know a ton about JO, but the shader systems should be the same between the two games. If not you'll need to go track yourself down a seasoned JO modder.

Inyri is offline   you may: quote & reply,
Old 06-20-2008, 04:48 PM   #5
haravikk
 
Join Date: Nov 2002
Posts: 11
Thanks your help! I found a couple examples and it seems to be working as expected, though needs a load of tweaking yet, cheers!
haravikk is offline   you may: quote & reply,
Old 06-21-2008, 08:42 AM   #6
haravikk
 
Join Date: Nov 2002
Posts: 11
Okay, one other question; what is the best way to do bump-mapping on a character? I think I investigated before attempting to get a normal-mapping style effect on a skin and didn't have much luck; is there any recommended way to make a surface on a skin look "bumpy" even when light is applied to it?

I don't require proper bump-mapping; as I understand it this is only really possible on map surfaces and even then isn't perfect; however, I'd like to create an effect as close as possible.
haravikk is offline   you may: quote & reply,
Old 06-21-2008, 02:28 PM   #7
Inyri
The Magical Malefactor
 
Inyri's Avatar
 
Join Date: Sep 2004
Location: Chicago
Posts: 2,505
Current Game: Mass Effect 3
Veteran Modder Forum Veteran Helpful! Contest winner - Fan Fiction 
You can't do bump-mapping in JK2 or JK3. The engine does not support it.

If you want to do "fake" bump mapping you'll have to texture it onto the model and the spec map and hope it looks half decent.

Inyri is offline   you may: quote & reply,
Old 06-22-2008, 12:18 PM   #8
haravikk
 
Join Date: Nov 2002
Posts: 11
Hmm, in that case; is there at least a way to make parts of a texture always appear dark? E.g - so that colour appears as texture_colour * light, so black areas that are fully lit will remain black?

Or is this something shaders can't control and will need some trickery with a layer that ignores lighting (in the same way you would do a "full-bright" glow effect)? I'd rather avoid an extra layer as a rule, since I prefer not to have more than four stages in a shader, especially on a player model.
haravikk is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JO Skinning > Advanced light-based shading

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:49 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.