Nov 27, 2017 - Shader dev, exploring game mechanics
Looks like another late Monday entry for the previous week... So, the past week was full of distractions with the holiday and all but I guess I managed to do quite a bit, at least there's an entertaining video to go with this week's blog post...
About the video:
I came up with the idea for the video while playing with the scanners game with my HTC Vive. I find that the HTC Vive inspires more physical game-play because of the way roomscale gives you more freedom to move around. But to be fair, I had started forming the idea for this video before I got my vive back up and running.
Side note: My vive was out-of-order for months due to a bad lighthouse base station. I got a new one on ebay and it runs like new again!
So, in addition to writing this weekly blog, I try to post something new once a week on Instagram. I wanted to post something different from exploding heads so I came up with the "steamroller" idea, captured it and posted it and I was rewarded with a good number of views and several new subscribers.
During the week I made a few tweaks to make the targeting system for the telekinetic power thing to be more "sticky" i.e. you can move your arm a lot farther without dropping the target object. This made it possible to use more aggressive hand motions to "throw" the ragdolls around which resulted in me coming up with the pinwheel, fishing, and yoyo techniques. Then I thought I needed one more so I added whack-a-mole, kind of as a joke. But now I'm tempted to make a scoring system for each different game type.
But yeah, I just thought it would be a really funny idea for an Instagram post. I guess instagrammers like it because at the moment it has more that 1400 views.
Blood shader tweaks:
With a lot of trial and error I managed to get the feathered edges grad from reflective to non-reflective without any unwanted artifacts. I also added distance/angle filtering, a trick I learned when I was writing shaders for feature animation. In animation I did this to avoid chattering artifacts when viewed at a distance. In the game engine it's more of an optimization since it would theoretically reduce the amount of computation that gets done when drawing at a distance.I don't know if this will be useful for anyone but here's the current shader I'm using. It looks at the alpha channel in the texture map and draws "blood" wherever the alpha approaches 1 and is transparent where the alpha approaches 0.
Shader "Shimmy/BloodShader" { Properties { _Color ("Color", Color) = (1,0,1,1) _MainTex ("ColorMap", 2D) = "white" _MinDistance("Min Distance", Float) = 3 _MaxDistance ("Max Distance", Float) = 20 } SubShader { CGPROGRAM #pragma surface surf StandardSpecular alpha sampler2D_half _MainTex; fixed4 _Color; float _MaxDistance; float _MinDistance; struct Input { float2 uv_MainTex; float3 worldPos; float3 viewDir; float3 worldNormal; }; void surf (Input IN, inout SurfaceOutputStandardSpecular o) { half dist = distance(_WorldSpaceCameraPos, IN.worldPos); half myDot = dot(IN.worldNormal,normalize(IN.viewDir)); half distMult = lerp(2, .1,(myDot+1) * .5);//dot approaches 1 dist is closer dist *= distMult; if (dist < _MaxDistance){ fixed4 c = tex2D (_MainTex, IN.uv_MainTex); o.Albedo = _Color.rgb; o.Smoothness = c.a;//spec; o.Alpha = c.a * .8 * (1 - saturate(lerp(0,1,(dist - _MinDistance) / (_MaxDistance - _MinDistance)))); } } ENDCG } FallBack "Standard" }
Other less interesting tweaks:
There was an artifact at the edges of the blood splatter planes so I dug up a plane that I had built with a margin around the UVs so they don't bleed over to the other side. Eventually I will attempt to rewrite the blood shader to draw the blood pass procedurally so I don't need separate planes.Switched back to 90 degree turning instead of 45 degrees. What was I thinking?
What I'm watching:
Dr. Penny de Byl's shader tutorial:I'm only about halfway done watching the tutorial which I got at Udemy.com.
What I'm playing:
Everybody's gone to the rapture:
Actually, I didn't enjoy this. I bought it on PS4 for the full retail price because I thought I would enjoy playing on console. I could have bought it on sale on Steam and now I really regret it. I'm pretty sure I would have enjoyed this a lot more from the comfort of my laptop. Anyway, I know a lot of people enjoy games like this. I think it was recommended to me because I loved playing Firewatch. But this game just didn't do it for me. And the beautiful visuals didn't really come across on the PS4, another reason I think I would have enjoyed it more on PC.
Arizona Sunshine:
This is now my favorite game to play in VR... I got my HTC Vive up and running just in time for Thanksgiving so I knew it was time to buy this game. Some games you just need to do in room scale. I must admit I love shooting zombies in VR and when they run up close to you that really gets your heart racing.
One recommendation I have for anyone who wants to play this game is to make sure you go into the settings and turn on "Advanced CPU Extras". It makes the game much more interactive and immersive (limbs get blown apart and glass breaks).
By default the game uses teleportation for locomotion which works just fine. But since my own "game" (if that's what you wanna call it) currently uses a walking motion which doesn't make me sick, I thought I'd give it a try in Arizona Sunshine. It made me sick instantly. I find this interesting and worth investigating. I wonder if I got sick because of the speed of the motion is relative to the how far you push the thumbstick/touchpad making the velocity change rapidly depending on how shaky your hands are. I also think the uneven terrain could be part of the problem.
So, one area I need to explore still is a locomotion mechanic over uneven terrain. This will go hand-in-hand with getting my blood splatter tech to work on an uneven surface.
Comments
Post a Comment