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 | 
 

 Changing grass shading?

Go down 
AuthorMessage
ZombieKitteh

avatar

Game username : Zombie
Server : Mythical Realms (Co-Admin)
Female Posts : 49
Join date : 2013-01-26
Age : 27
Location : Snowdin & Alternia

PostSubject: Changing grass shading?   Tue Mar 20, 2018 12:19 am

We're adding shading and messing about with ambient and lighting on our server. And it looks really great, but our grass stands out super bad now at night time. Does anyone know of a way to darken the grass to make it have shading or lighting like the rest of the map and meshes? Super stumped with this one. I'd assume maybe it'd be a material thing, but we can't figure it out.

Back to top Go down
http://zombiekitteh.deviantart.com
Hamilton

avatar

Game username : Hamilton
Server : Myatar Legends // Dragon's Den
Female Posts : 395
Join date : 2011-10-20
Age : 32
Location : everywhere

PostSubject: Re: Changing grass shading?   Tue Mar 20, 2018 12:45 am

got to turn lighting on for grass in the source. file is magixworld. find:

Quote :
if(mDef->hasVertexProgram)
{
l->setAnimationEnabled(true); //Enable animations
l->setSwayDistribution(0.05f); //Sway fairly unsynchronized
l->setSwayLength(0.7f); //Sway back and forth 0.5 units in length
l->setSwaySpeed(0.5f); //Sway 1/2 a cycle every second
l->setLightingEnabled(true);
}

notice mine here has the line

Quote :
l->setLightingEnabled(true);

mm*double checks* yeah. the unchanged sources don't have this line. it auto sets to false so you have to manually add the line in like that with true to activate. it will then allow the grass material file to control lighting.
Back to top Go down
ZombieKitteh

avatar

Game username : Zombie
Server : Mythical Realms (Co-Admin)
Female Posts : 49
Join date : 2013-01-26
Age : 27
Location : Snowdin & Alternia

PostSubject: Re: Changing grass shading?   Wed Mar 21, 2018 5:37 am

Thank you for the help! We added it to our game and it got a little buggy after ran through the updater. Unsure if it's a updater issue or.. something else. Lol. But I'm excited to have this tried out and see if it works. I'll let you know how it goes once things get settled.

I was worried we'd be doomed to have really eye blinding bright grass.
Back to top Go down
http://zombiekitteh.deviantart.com
lazyzim

™
avatar

Server : Dragon's Den
Male Posts : 756
Join date : 2011-11-27

PostSubject: Re: Changing grass shading?   Wed Mar 21, 2018 8:15 am

Try this in your material file.
Code:
material grass
{
 transparency_casts_shadows off
 receive_shadows off
 technique
 {
 pass
 {
           lighting on
 ambient 0.300000 0.300000 0.300000 1.000000
 diffuse 0.300000 0.300000 0.300000 1.000000
 specular 0.010000 0.010000 0.010000 1.000000
 emissive 0.000000 0.000000 0.000000 1.000000
 cull_hardware none
 cull_software none
 scene_blend alpha_blend
 alpha_rejection greater_equal 128
 
 texture_unit
 {
 texture grass2.png
 wave_xform scroll_x sine 1 .1 0 .05
 }
 }
 }
}

Cheers
~LazyZim~
Back to top Go down
Sponsored content




PostSubject: Re: Changing grass shading?   

Back to top Go down
 
Changing grass shading?
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: SUPPORT :: Support-
Jump to: