HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
The domain www.kitopen.com will expire on 2018-08-17. Update your bookmarks to point at http://kito.forumotion.com/
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 The underwater texture help? [solved, thanks]

Go down 
AuthorMessage
Shanol

avatar

Game username : Shanol
Server : Dragon's Den (Keeper), Azoptaos (Architect), G&R (Owner)
Male Posts : 37
Join date : 2014-04-03
Location : Alternative Kingdom

PostSubject: The underwater texture help? [solved, thanks]   Fri Oct 23, 2015 11:00 pm

Hello everyone.
I've got this in mind for long, but i couldn't find the way to bring it into my game, because i am still very bad at coding.
I am sorry for bad explaining beforehand, but i will try.

The problem is that i want to attach a texture screen just like the one you get when you are underwater, but i want it always when i enter the specific map.
Any help to bring it to game please?

Also i need some tips about how to make the texture animated.

[EDIT]: The texture must appear on the screen when i enter the map, not when diving underwater. The whole map should have the texture turned on.


Last edited by Shanol on Sun Nov 22, 2015 3:33 am; edited 2 times in total
Back to top Go down
http://shanol.deviantart.com
Witacha
3D Modeler
3D Modeler
avatar

Game username : Witacha
Server : Land Of The Wolves(Owner)
Female Posts : 1248
Join date : 2012-06-15
Age : 19
Location : France

PostSubject: Re: The underwater texture help? [solved, thanks]   Fri Oct 23, 2015 11:27 pm

Create Underwater.material + transparent texture

Code:
material PseudoShader/Underwater
{
 technique
 {
 pass
 {
 lighting off
 scene_blend alpha_blend
 depth_check off

 texture_unit
 {
 texture watershader.png
 tex_address_mode clamp
 }
 }
 pass
 {
 depth_check off
 scene_blend modulate
 texture_unit
 {
 colour_op_ex source1 src_manual src_current 0.75 0.9 1 1
 }
 }
 }
}}

To animate open water.material + create different frame of water

Code:
material Terrain/WaterMat
{
 technique
 {
 pass
 {
 cull_hardware none
 cull_software none
 scene_blend alpha_blend
 depth_write off
 texture_unit
 {
 anim_texture water01.png water02.png water03.png water04.png water05.png water06.png water07.png water08.png water09.png water0010.png water0011.png water0012.png water0013.png water0014.png water0015.png water0016.png water0017.png water0018.png water0019.png water0020.png water0021.png water0022.png water0023.png water0024.png water0025.png water0026.png water0027.png water0028.png water0029.png water0030.png water0031.png water0032.png 1
 scale 0.05 0.05
 scroll_anim -0.05 0.01
 }
 }
 }
}
Back to top Go down
http://witacha-asukata.deviantart.com/
Shanol

avatar

Game username : Shanol
Server : Dragon's Den (Keeper), Azoptaos (Architect), G&R (Owner)
Male Posts : 37
Join date : 2014-04-03
Location : Alternative Kingdom

PostSubject: Re: The underwater texture help? [solved, thanks]   Sat Oct 24, 2015 12:29 am

Witacha wrote:
Create Underwater.material + transparent texture

Code:
material PseudoShader/Underwater
{
 technique
 {
 pass
 {
 lighting off
 scene_blend alpha_blend
 depth_check off

 texture_unit
 {
 texture watershader.png
 tex_address_mode clamp
 }
 }
 pass
 {
 depth_check off
 scene_blend modulate
 texture_unit
 {
 colour_op_ex source1 src_manual src_current 0.75 0.9 1 1
 }
 }
 }
}}

To animate open water.material + create different frame of water

Code:
material Terrain/WaterMat
{
 technique
 {
 pass
 {
 cull_hardware none
 cull_software none
 scene_blend alpha_blend
 depth_write off
 texture_unit
 {
 anim_texture water01.png water02.png water03.png water04.png water05.png water06.png water07.png water08.png water09.png water0010.png water0011.png water0012.png water0013.png water0014.png water0015.png water0016.png water0017.png water0018.png water0019.png water0020.png water0021.png water0022.png water0023.png water0024.png water0025.png water0026.png water0027.png water0028.png water0029.png water0030.png water0031.png water0032.png 1
 scale 0.05 0.05
 scroll_anim -0.05 0.01
 }
 }
 }
}

I've created the Underwater.material in my Terrain folder and created a texture with transparency. Right?
Where should i put the second code (the 'WaterMat' one)? Because if i put it in my Terrain.material, it doesn't appear.
Back to top Go down
http://shanol.deviantart.com
Witacha
3D Modeler
3D Modeler
avatar

Game username : Witacha
Server : Land Of The Wolves(Owner)
Female Posts : 1248
Join date : 2012-06-15
Age : 19
Location : France

PostSubject: Re: The underwater texture help? [solved, thanks]   Sat Oct 24, 2015 2:26 pm

Shanol wrote:
I've created the Underwater.material in my Terrain folder and created a texture with transparency. Right?

The Underwater.material must be in the Script folder

Shanol wrote:
Where should i put the second code (the 'WaterMat' one)? Because if i put it in my Terrain.material, it doesn't appear.

The WaterMat should be in your Script folder, just edit it
Back to top Go down
http://witacha-asukata.deviantart.com/
Shanol

avatar

Game username : Shanol
Server : Dragon's Den (Keeper), Azoptaos (Architect), G&R (Owner)
Male Posts : 37
Join date : 2014-04-03
Location : Alternative Kingdom

PostSubject: Re: The underwater texture help? [solved, thanks]   Sat Oct 24, 2015 10:01 pm

Witacha wrote:
The WaterMat should be in your Script folder, just edit it

Got it, thank you. But it doesn't show on the screen when i am in the location. It only shows when i am underwater. I want it to be always on the screen. Kind of an overlay for the whole screen of the location.
Back to top Go down
http://shanol.deviantart.com
Witacha
3D Modeler
3D Modeler
avatar

Game username : Witacha
Server : Land Of The Wolves(Owner)
Female Posts : 1248
Join date : 2012-06-15
Age : 19
Location : France

PostSubject: Re: The underwater texture help? [solved, thanks]   Sat Oct 24, 2015 10:06 pm

Yeah it's only for "underwater" that's why it's called "underwater" xD
What do you mean?
Back to top Go down
http://witacha-asukata.deviantart.com/
Shanol

avatar

Game username : Shanol
Server : Dragon's Den (Keeper), Azoptaos (Architect), G&R (Owner)
Male Posts : 37
Join date : 2014-04-03
Location : Alternative Kingdom

PostSubject: Re: The underwater texture help? [solved, thanks]   Sun Oct 25, 2015 12:41 am

Witacha wrote:
Yeah it's only for "underwater" that's why it's called "underwater" xD
What do you mean?

I mean:
Shanol wrote:
I want it to be always on the screen. Kind of an overlay for the whole screen of the location.
Sorry, i do not know how else to explain it.
I want my choosen texture to be applied directly to the screen when i enter choosen location, just like what happens on the screen when i am underwater, but my own texture and always on the screen, when i am in the location.
Back to top Go down
http://shanol.deviantart.com
Witacha
3D Modeler
3D Modeler
avatar

Game username : Witacha
Server : Land Of The Wolves(Owner)
Female Posts : 1248
Join date : 2012-06-15
Age : 19
Location : France

PostSubject: Re: The underwater texture help? [solved, thanks]   Sun Oct 25, 2015 2:00 pm

Is there a way you can make a picture to represent what your trying to explain because i don't understand
Back to top Go down
http://witacha-asukata.deviantart.com/
Shanol

avatar

Game username : Shanol
Server : Dragon's Den (Keeper), Azoptaos (Architect), G&R (Owner)
Male Posts : 37
Join date : 2014-04-03
Location : Alternative Kingdom

PostSubject: Re: The underwater texture help? [solved, thanks]   Fri Nov 20, 2015 10:57 pm

Witacha wrote:
Is there a way you can make a picture to represent what your trying to explain because i don't understand

I wish i could but i think just a picture wouldn't explain that.

Imagine a shooter game, where you play at the first person. When someone hits you there is a texture of blood splatters appears on the screen or just a red rim around the screen.
Now imagine that i need a texture which will apear the same way, but not when someone hits me, but when i enter the map, and it won't disappear until i leave that map.
Back to top Go down
http://shanol.deviantart.com
ShadoWolfozo

avatar

Game username : ShadoWolfozo
Server : GROWL: Spirits
Male Posts : 875
Join date : 2012-01-22
Age : 22
Location : Australia

PostSubject: Re: The underwater texture help? [solved, thanks]   Sat Nov 21, 2015 3:20 am

Basically you want something to appear on the screen like the water shader but not, and permanent while in the map regardless of where you are, yes?
I intend to do something similar for GROWL for a specific map too.

You'd need to create a new shaderflag in the compile and tell it to activate and deactivate on specific events.

Tell it to check if you're in a certain map and if you are, to activate or deactivate.

E.g. Enter Map A, D or F activates the shader but entering Map B, C or E deactivates it.


Take a look at the underwatershader and worlds related codes in the compile.
Back to top Go down
Shanol

avatar

Game username : Shanol
Server : Dragon's Den (Keeper), Azoptaos (Architect), G&R (Owner)
Male Posts : 37
Join date : 2014-04-03
Location : Alternative Kingdom

PostSubject: Re: The underwater texture help? [solved, thanks]   Sat Nov 21, 2015 9:00 pm

ShadoWolfozo wrote:
Basically you want something to appear on the screen like the water shader but not, and permanent while in the map regardless of where you are, yes?
I intend to do something similar for GROWL for a specific map too.

You'd need to create a new shaderflag in the compile and tell it to activate and deactivate on specific events.

Tell it to check if you're in a certain map and if you are, to activate or deactivate.

E.g. Enter Map A, D or F activates the shader but entering Map B, C or E deactivates it.


Take a look at the underwatershader and worlds related codes in the compile.

Thank you, this is what i need.
I only start in coding.. could you give me an example code or something like that, if that's ok?
I am sorry for being so impudent.
Back to top Go down
http://shanol.deviantart.com
ShadoWolfozo

avatar

Game username : ShadoWolfozo
Server : GROWL: Spirits
Male Posts : 875
Join date : 2012-01-22
Age : 22
Location : Australia

PostSubject: Re: The underwater texture help? [solved, thanks]   Sun Nov 22, 2015 2:52 am

You have a piece of code that checks if the shader is activated or not

Code:
underwaterShaderFlag = false;

Basically you need to create another one, e.g.

Code:
customShaderFlag = false;

And when it enters a new map, actviate the shader.

I can't give you the full code, because I haven't played with it and don't know it yet, but there'll be a code in there that determines what happens when you load a new map / world. In there, you tell it to do a check for if you're in Map A, B, or T and if you are activate the shader else don't.

I'm not a coder, so this is where my help ends. Sorry.
Back to top Go down
Shanol

avatar

Game username : Shanol
Server : Dragon's Den (Keeper), Azoptaos (Architect), G&R (Owner)
Male Posts : 37
Join date : 2014-04-03
Location : Alternative Kingdom

PostSubject: Re: The underwater texture help? [solved, thanks]   Sun Nov 22, 2015 3:30 am

ShadoWolfozo wrote:
You have a piece of code that checks if the shader is activated or not

Code:
underwaterShaderFlag = false;

Basically you need to create another one, e.g.

Code:
customShaderFlag = false;

And when it enters a new map, actviate the shader.

I can't give you the full code, because I haven't played with it and don't know it yet, but there'll be a code in there that determines what happens when you load a new map / world. In there, you tell it to do a check for if you're in Map A, B, or T and if you are activate the shader else don't.

I'm not a coder, so this is where my help ends. Sorry.

Thank you very much, i will use this in future.
Back to top Go down
http://shanol.deviantart.com
Sponsored content




PostSubject: Re: The underwater texture help? [solved, thanks]   

Back to top Go down
 
The underwater texture help? [solved, thanks]
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 :: Solved Support Issues-
Jump to: