HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 Terrain Lighting w/Multiple Masks Example

View previous topic View next topic Go down 
AuthorMessage
Nefadozone

avatar

Game username : Nefadozone
Server : Fucko McShitpo
Male Posts : 176
Join date : 2011-11-11
Age : 23
Location : Satan's Asshole

PostSubject: Terrain Lighting w/Multiple Masks Example   Sun Sep 13, 2015 7:09 pm

Note some things for edits:
to make another mask layer, copy another pass ABOVE the final LIGHTING pass.

do not enable lighting for any other part of the material.

no tweaking of anything but the final ambient/diffuse and the texture names should be done, unless you are experienced with ogre materials. if you need help, feel free to post a reply to this topic!

ambient 0.55 0.55 0.55 1

ambient lighting, for best results set to your outdoor ambient. if it is an indoor map, set to your indoor ambient. you should also set your day/night/dusk/dawn cycle to change the environment's ambient lighting based on the time of day (four ambient values total) in the source code for your server. would require an experienced coder.

1 is the ALPHA of the ambient. even if you set your ambient of the terrain to 0 0 0, the alpha will control the transparency of the shading. I recommend that you don't touch this value unless you know what you are doing.

diffuse 0.2 0.8 1
diffuse color can be tweaked for best results. this number above produces a greenish tinge, most will do best with 1 1 1 unless you're trying to go for something otherworldly.

see the ogre material manual, ogre wiki, and the ogre forums for more information if you're curious on how to make complex materials and shaders.




enough blabbering, here's the material for my home map.

Code:

material Terrain/HomeTerrain
{
receive_shadows on
technique
{
pass
{
lighting off
texture_unit
{
texture HomeBaseTex.png
scale 0.025 0.025
}
}
pass
{
lighting off
scene_blend alpha_blend
depth_func equal
texture_unit
{
texture SDDefaultMask1.png
alpha_op_ex source1 src_texture src_texture
colour_op_ex source2 src_texture src_texture
}
texture_unit
{
texture HomeTex1.png
scale 0.02 0.02
colour_op_ex blend_diffuse_alpha src_texture src_current
}
}
pass
{
lighting off
scene_blend alpha_blend
depth_func equal
texture_unit
{
texture SDDefaultMask2.png
alpha_op_ex source1 src_texture src_texture
colour_op_ex source2 src_texture src_texture
}
texture_unit
{
texture HomeTex2.png
scale 0.035 0.035
colour_op_ex blend_diffuse_alpha src_texture src_current
}
}
pass
{
lighting off
scene_blend alpha_blend
depth_func equal
texture_unit
{
texture SDDefaultMask3.png
alpha_op_ex source1 src_texture src_texture
colour_op_ex source2 src_texture src_texture
}
texture_unit
{
texture HomeTex3.png
scale 0.035 0.035
colour_op_ex blend_diffuse_alpha src_texture src_current
}
}
pass
{
ambient 0.55 0.55 0.55 1
diffuse 0.2 0.8 1
depth_func equal
scene_blend zero src_colour
}
}
}

may be formatted odd due to spaces that don't show up in notepad++





now i did say something about the ambient and diffuse values up top. i do want to re-state some of those things again to those who read a little too quick, and point another thing out.

you can remove a pass above the lighting pass if you have less masks. if you have no masks at all, you can remove all of the mask passes then have a lighting pass after the first texture.

your terrain's ambient should depend on your ambient that you set in Gameconfig.h, indoor maps set to the indoor ambient (the fourth 1 value should remain 1 in the material), and the outdoor maps set to the outdoor value. the diffuse value should honestly just be 1 1 1, or 0.25 0.25 0.25, you will discover what suits you best when you experiment with this material.

 pale


Last edited by Nefadozone on Sun Sep 13, 2015 10:25 pm; edited 1 time in total (Reason for editing : fixed up the material a little bit for readability.. sorry)
Back to top Go down
http://wildmidnight.boards.net/
KyenTheDragon

avatar

Game username : Kyen
Server : Kybrid Pawz
Posts : 43
Join date : 2015-09-06
Location : Puerto Rico

PostSubject: Re: Terrain Lighting w/Multiple Masks Example   Thu May 11, 2017 6:45 pm

yesh i really need help with this qwq
Back to top Go down
 
Terrain Lighting w/Multiple Masks Example
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: DOWNLOADABLE CONTENT :: Programming Features-
Jump to: