Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (SBGuy, dr_panther, Ayumi, Quad, AndrewAMD), 920 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Shockwave Shader #462133
09/11/16 14:30
09/11/16 14:30
Joined: Jun 2010
Posts: 212
tagimbul Offline OP
Member
tagimbul  Offline OP
Member

Joined: Jun 2010
Posts: 212
hey =)
i try to make a shockwave shader on a sprite.
like this
http://forum.unity3d.com/attachments/shockwave-png.151238/

i have use this shader for basic.
http://opserver.de/swik10/index.php?title=Raindrops

i use it on a entity but now is my problem the thats the pixels behind of the enity no have this effect.
how i can make tath all the pixels behind the entity become this effect? like on the picture
greets tom


edit:
final shader:
https://www.dropbox.com/sh/aad9ob2xixmkplb/AAALpOfHKKP90CWLMwe9eb-Ha?dl=0

Last edited by tagimbul; 09/15/16 11:06.

meine website mit 3dgs sachen =) //noch nicht ganz umgebaut ^^"
http://flashbreaker.com/home.html
und mein YT channel mit diversen game entwicklungs videos, vor allem shader zeugs
https://www.youtube.com/user/tagimbul/videos
Re: Shockwave Shader [Re: tagimbul] #462136
09/11/16 16:13
09/11/16 16:13
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
The raindrops shader is a post effect on the camera.
IF you want to use it you have to do some calculations and convert the 3D position into 2D pos onto the screen.

Re: Shockwave Shader [Re: Ch40zzC0d3r] #462139
09/11/16 18:05
09/11/16 18:05
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Maybe it's better to archive this effect with post shader effect. You better ask some shader gurus around the forum, it would be nice to have such an effect lying around the forum (HDD as well).

Youtube example

Greets!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Shockwave Shader [Re: 3run] #462141
09/11/16 18:50
09/11/16 18:50
Joined: Jun 2010
Posts: 212
tagimbul Offline OP
Member
tagimbul  Offline OP
Member

Joined: Jun 2010
Posts: 212
i dont need it as a PP shader

https://www.dropbox.com/sh/dhc2f6yxxr14rxy/AADRfDkIliRmlWOYDNIYlTuIa?dl=0

i wrote it in a object shader... but i have absolutly no idea how to make it invesible so that it deforms the background in the level and not the own texture or like a PP shader on the camera view....

hey gurus in the forum grin pls help me grin

Last edited by tagimbul; 09/11/16 18:50.

meine website mit 3dgs sachen =) //noch nicht ganz umgebaut ^^"
http://flashbreaker.com/home.html
und mein YT channel mit diversen game entwicklungs videos, vor allem shader zeugs
https://www.youtube.com/user/tagimbul/videos
Re: Shockwave Shader [Re: tagimbul] #462155
09/12/16 09:53
09/12/16 09:53
Joined: Jun 2010
Posts: 212
tagimbul Offline OP
Member
tagimbul  Offline OP
Member

Joined: Jun 2010
Posts: 212
i project the render view now on the object with TargetMap =)
then i use alphamap as mask and the normalmap.
the only one probleme that i now have is convert the targetmap on the object but with the screen coordinates and nor the object coordinates =)
if i have this my shader is finish =)

Last edited by tagimbul; 09/12/16 09:54.

meine website mit 3dgs sachen =) //noch nicht ganz umgebaut ^^"
http://flashbreaker.com/home.html
und mein YT channel mit diversen game entwicklungs videos, vor allem shader zeugs
https://www.youtube.com/user/tagimbul/videos
Re: Shockwave Shader [Re: tagimbul] #462156
09/12/16 11:03
09/12/16 11:03
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
you can use VPOS to get your screen coordinates:

Code:
float4 PShader(in float4 vScreenPos : VPOS, ...) : COLOR0
{
   float2 TexcoordScreen = (vScreenPos.xy + 0.5) / vecViewPort.xy;

   ...
}

x and y of the VPOS-register represent the coordinate of the pixel (1 unit = 1 pixel!)
the '+ 0.5' is needed to sample from the center of the pixel because the top-left pixel's coordinates are (0, 0) not (0.5, 0.5)
finally, dividing by vecViewPort.xy transforms the coordinates to the [0 - 1] range which is needed (edit: you can also use '* vecViewPort.zw')

Last edited by Kartoffel; 09/12/16 11:10.

POTATO-MAN saves the day! - Random
Re: Shockwave Shader [Re: Kartoffel] #462158
09/12/16 12:00
09/12/16 12:00
Joined: Jun 2010
Posts: 212
tagimbul Offline OP
Member
tagimbul  Offline OP
Member

Joined: Jun 2010
Posts: 212
ahh ^^ ich hab vermutet das ich mit VPOS und vecViewPort was machen muss^^
danke vielmal grin
ich habs gleich mal getestet. aber jetzt hab ich ein nues problem
damit es funktioniert muss man noch die shader version erhöhen oder?
also
Code:
PixelShader = compile ps_3_0 PS_RainDrops();


wenn ich den von 2 (meine eigentliche version für den raindrop shader) auf 3 erhöhe bekomme ich zwar die pixel vom render target in screengrösse auf das objekt geschriben aber die anderen bilder (mtlskin1 und entskin1) werden nichtmehr durchgelassen...

hmm..

wenn ich im code, wie er bisher funktioniert hat ohne denn VPOS zusatz, den compile ps_2_0 PS_RainDrops(); auf ps_3_0 erhöhe geht es nicht mehr. woran liegt das? also das model wird unsichtbar
Code:
float4 PS_RainDrops(float2 tex0 : TEXCOORD0 ) : COLOR
{
	float2 temp;
	temp.x = tex0.x+vecTime.w/100;
	temp.y = tex0.y+vecTime.w/100;
	
	 
	
	float2 pixel = tex2D(bumpTex,temp).rg*5;
	
	temp.x = (tex0.x + pixel.x * 0.01f);
	temp.y = (tex0.y + pixel.y * 0.01f);

	float4 pixel2 = tex2D(targetmap,temp)  ;
	
	

	
	//rgba
	return float4(tex2D(postTex, temp*(1-pixel.x*0.01f)).rgb, tex2D(postTex, temp*(1-pixel.x*0.01f)).a-pixel2.a)+pixel2;
	
}

// Technik 1
technique tech_00
{
	pass pass_00
	{
		PixelShader = compile ps_2_0 PS_RainDrops();
	}
}

technique fallback { pass one { } }




Last edited by tagimbul; 09/12/16 12:01.

meine website mit 3dgs sachen =) //noch nicht ganz umgebaut ^^"
http://flashbreaker.com/home.html
und mein YT channel mit diversen game entwicklungs videos, vor allem shader zeugs
https://www.youtube.com/user/tagimbul/videos
Re: Shockwave Shader [Re: tagimbul] #462162
09/12/16 13:00
09/12/16 13:00
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
ich glaub', dass das modell unsichtbar wird, hat was damit zu tun dass du keinen vertexshader verwendest, PS3.0 aber einen vorraussetzt? kann mich aber auch irren...


POTATO-MAN saves the day! - Random
Re: Shockwave Shader [Re: Kartoffel] #462163
09/12/16 13:35
09/12/16 13:35
Joined: Jun 2010
Posts: 212
tagimbul Offline OP
Member
tagimbul  Offline OP
Member

Joined: Jun 2010
Posts: 212
ja das war es grin grin cool es funktioniert grin ahh bin so happy grin danke danke grin
wein mein shockwave fertig ist poste ich ihn hier grin
kann man dann auch als haze flame shader nutzen auf einzelnen sprites^^


meine website mit 3dgs sachen =) //noch nicht ganz umgebaut ^^"
http://flashbreaker.com/home.html
und mein YT channel mit diversen game entwicklungs videos, vor allem shader zeugs
https://www.youtube.com/user/tagimbul/videos
Re: Shockwave Shader [Re: tagimbul] #462173
09/12/16 21:35
09/12/16 21:35
Joined: Jun 2010
Posts: 212
tagimbul Offline OP
Member
tagimbul  Offline OP
Member

Joined: Jun 2010
Posts: 212
https://www.dropbox.com/sh/aad9ob2xixmkplb/AAALpOfHKKP90CWLMwe9eb-Ha?dl=0

er ist beinahe fertig... aber irgendwo mach ich noch was falsch
wenn ich die (* 0.01f) entferne in zeile 92 löst es mir gleich 2 probleme
einmal die diagonale ferzerung und die scalierung.
aber der effect sieht dann nicht mehr gut aus..
aber es ist schon sehr nahe an am endresultat grin

edit:
ich hab ein neues bild geupdatet in dropbox. das entfernen des (* 0.01f) bringt nichts.
*grübel grübel*

Last edited by tagimbul; 09/12/16 21:54.

meine website mit 3dgs sachen =) //noch nicht ganz umgebaut ^^"
http://flashbreaker.com/home.html
und mein YT channel mit diversen game entwicklungs videos, vor allem shader zeugs
https://www.youtube.com/user/tagimbul/videos
Page 1 of 2 1 2

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1