Tuesday, October 28, 2014

On Internet Arguments, Feminism, and GamerGate

I've been having a pretty interesting discussion about criticism, feminism, and videogames on Youtube, and I felt a need to preserve it, so I'm copying the conversation here. What I find interesting about this conversation is that as it has gone on, the anger and immediacy of the conversation has worn off, and we've managed to find some common ground.

I haven't written much about feminism or representation in videogames here, but it is a subject that is close to my heart. At least part of my posting of this was prompted by FilmCritHulk's excellent and amazingly empathetic essay here: http://badassdigest.com/2014/10/27/film-crit-hulk-smash-on-despair-gamergate-and-quitting-the-hulk/ . I want to try to bring to bear some of his calm demeanor in my own discussions -- especially around touchy subjects like GamerGate and feminism. I have these kinds of conversations all the time, so I felt the need to time-capsule this one up as an example. This is not an example of someone winning an internet argument. This is not me bragging about how good I am at arguing on the internet. This is just an example of two people managing to reach some amount of common ground.

This conversation is in response to the ExtraCredits & IdeaChannel collab video here: http://www.youtube.com/watch?v=7lPUlN0dnKk

Fair warning: this is a really long internet argument that turns into a really long internet discussion.

Monday, October 20, 2014

ShaderLab + CG highlighting for Notepad++

I finally got around to fixing my style and code highlighting for Unity Shaderlab CG in Notepad++. If you want something similar you can download it here: link
To import it, download this file to Appdata>Roaming>Notepad++ . Then, in Notepad++, go to Language>Define Your Language... and click the import. Make sure you set your global background style to something dark (Settings>Style Configurator>Enable Global Background Colour).

It's based on Luiz Alvarez's CG highlighting, with some color style edits to make it look better and work on a dark background, and additional keywords added so that major shaderlab terms are highlighted.

Tuesday, October 7, 2014

Hatching Shader

I was troubleshooting some shader problems on the Unity forums, and ended up overhelping and making a pretty decent-looking crosshatching shader (if I do say so myself). Here's what it looks like:


The UV math is a little messed up, but I think it looks pretty cool :D.

---edit---

(can't stop. won't stop) I went ahead and fixed the uv math. It now uses the UVs of MainTex rather than of Hatch0 as it's main input. I was going to resolve (read: "re - solve" as in "solve again") all of the other UVs separately, but it made the inputs a pain to set up when making a new material, so I just left the Hatch Density input.

Friday, October 3, 2014

Explosions with shockwaves

So, implementing this in a dynamic way is still giving me some lingering sorting/rangefinding problems, but I think this effect has legs :)


The green lines are debug. The explosion effect performs a check to see how far away it is from the ground and then spawns user-defined secondary effects based on how close it is. These effects also fade out the farther away the explosion occurs (by manipulating the start color alpha value of the shockwave effects). As you can see on the left, those two explosions are close enough to the ground to kick up a vertical column of debris underneath them. The explosion on the right is too high, and only spawns the shockwave ring. 

These effects can also be delayed slightly to give the impression that it took time for the expanding pressure wave to reach the ground and kick up the dust.

You can also see the sorting errors that are currently causing me trouble :/ Unity never has been very good at sorting particle effects. Does anyone know a good way around this problem?

Thursday, October 2, 2014

Lit Particle Shaders Demo

I've been working on some custom shaders for Shuriken particle effects in Unity. The main idea is to fill gaps that currently exist in the available alpha blended material.


Crucially, the default alpha blended material does not receive light from the scene -- not ambient or direct illumination. I originally wanted to also support point lights, but with the current limits on what data you can know about particle positions and normals, it ends up being a fairly complicated and performance-prohibitive feature.

That's why my shader supports lighting from directional sources and ambient sources. I did manage to get vertical hemispherical lighting working, so particles can receive disparate lighting from the top and bottom (either directional on top or on bottom).

There's also not good default way of modelling emissivity in particles. You have to either have two particle systems with two different materials one alpha and the other additive, or take what you can fudge from the alpha blended. I found myself always making "glow" particle effects to play alongside other effects, so I just wrote a shader that supports that kind of effect by using multiple passes and materials. Unfortunately, Shuriken can only pass one float4 value through the vertex color input of a CG program, so the "color" values in the Shuriken system only refer to the glow color and the general alpha of the particle. The "background" color of the particle can only be adjusted per-material. This turns out to not be much of a problem in practice, though, and it's an unambiguous step up from the default workaround for this effect.

Anyway, I hope to make it available for purchace on the asset store shortly.