Jump to content
  • Advertisement

Unity Daily Update #7 - Another plane of being



During the past days, lots of shaders were updated and other visual things did too.

Firstly, I've added lights effects when the crystals get shattered. There's also a burst of particle emanating from the broken crystal on impact.

Also, enemies now leave a ragdoll corpse behind when they die. I love some of the poses those ragdolls make.

On another note, I've toyed around with corpse removal and got captivated by the shrinking effect it created.


It can sometimes be off-putting, but I'm still captivated.

I've also added a nice VHS-like effect from layering two VHS shader together; namely "more AVdistortion" and "VHS pause effect".

I've already ported the former and it's already active and the latter was just a matter of porting GLSL shaders to HLSL. No biggie.

I did change the code a bit to make the white noises move through time. And there's nothing like trigonometry to help us with that

fixed4 frag (v2f i) : SV_Target
	fixed4 col = fixed4(0, 0, 0, 0);
	// get position to sample
	fixed2 samplePosition = i.vertex.xy / _ScreenParams.xy;
	float whiteNoise = 9999.0;
	// Jitter each line left and right
	samplePosition.x = samplePosition.x + (((rand(float2(_UnscaledTime, i.vertex.y))-0.5)/64.0) * _EffectStrength );
	// Jitter the whole picture up and down
	samplePosition.y = samplePosition.y + (((rand(float2(_UnscaledTime, _UnscaledTime))-0.5)/32.0) * _EffectStrength );
	// Slightly add color noise to each line
	col += (fixed4(-0.5, -0.5, -0.5 , -0.5)+fixed4(rand(float2(i.vertex.y,_UnscaledTime)),rand(float2(i.vertex.y,_UnscaledTime+1.0)),rand(float2(i.vertex.y,_UnscaledTime+2.0)),0))*0.1;

	// Either sample the texture, or just make the pixel white (to get the staticy-bit at the bottom)
	whiteNoise = rand(float2(floor(samplePosition.y*80.0),floor(samplePosition.x*50.0))+float2(_UnscaledTime,0));
	float t = sin(_UnscaledTime / 2);

	if (whiteNoise > 11.5-30.0*(samplePosition.y + t) || whiteNoise < 1.5-5.0*(samplePosition.y + t) ) {
		// Sample the texture.
		col = lerp(tex2D(_MainTex ,samplePosition) , col + tex2D(_MainTex ,samplePosition), _EffectStrength);
	} else {
		// Use white. (I'm adding here so the color noise still applies)
		col = lerp(tex2D(_MainTex ,samplePosition), fixed4(1, 1, 1,1), _EffectStrength);

	return col;

It's nice to have HLSL code, but a video is better:



Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Advertisement
  • Blog Entries

  • Similar Content

    • By Nilmani Gautam
      Unity is a cross-platform game engine developed by Unity Technologies, first announced and released in June 2005 at Apple Inc.'s Worldwide Developers Conference as an OS X-exclusive game engine. As of 2018, the engine has been extended to support 27 platforms.
      I have started a video tutorial on A Complete Game Development course using Unity3d on YouTube. It is completely a beginner to advance course so any on can visit and learn to code and design game from beginning.
      Course will be updated daily.
      Visit here for more information.

    • By sevenfold1
      I'm looking for a open source PBR rendering engine that I can use.  Basic requirements are Windows (C/C++) and free to use type license.

      The first two hits I get on Google are:



      Does anybody have any experience using any of these, or do you recommend something else that's better?
      Pluses: Active development, easy to compile, zero dependencies.
    • By HappyCoder
      What is the game like
      I'm working on a game where the main mechanic is the player creates their own spells. They create spell using a sort of visual programming language
      Here is a diagram showing how the spell system would work

      The top spell would shoot fire out of the casters hand
      The second spell would shoot a projectile in a straight line until it hit something with no other effects
      The third spell would shoot a projectile and when it hits, explodes in a fireball
      Armed with only their knowledge of magic the player must navigate through caves and dungeons looking for artifacts and spells to allow them to become a master of the magic arts.
      What I have so far
      I prototype of the spell creation system. The user can draw symbols using an oculus touch controller in the air. The computer recognizes the symbol and the user can then move the symbols around to construct spells.
      List of spells I have working at the moment
      Fire - does damage, burns wood, and can light torches Wind - pushes objects and puts out torches Levitate - causes the target to become weightless, when used with wind you can push even heavy objects Light - a bright light used to light up dark areas What I need
      It would be great to have an artist to work with. I am going ahead doing the artwork on my own but having somebody who could take that too let me focus on the other aspects would be of great help
      I would also like if somebody would take on the role of designing levels. I think this game will rely on having many different interesting encounters to force them to come up with clever solutions to problems using their magic. It would be helpful to have somebody to collaborate with for ideas in the category and to focus on trying different levels out to help me focus on the programming.
    • By Rob_I
      I have a specific need to launch a game from an existing app.  Has anyone come across a game engine that can be built in this way?  Any help would be appreciated.
      Thank you!

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!