Jordan's Log: Week 6
- Jordan Sanderson
- Mar 13, 2017
- 3 min read
This week was an odd one. I spent most of my time this week bug fixing the mobile platform. Again Unity forced me to write my own shader that is completely necessary for our game to work. It was a fog shader since Unity’s built in fog doesn’t work on any mobile platform (this includes Windows Phone, Android, iOS, and Playstation Vita). You’d think Unity would have a shader for this or there would be a easily found tutorial on how to fix this. You’d be wrong on both accounts. I eventually found a website with a hidden tutorial that is for Windows Phone (that we are not even porting our game to) but fixes it for all mobile devices. Basically, I grab all the settings from Unity’s built in fog then use my fog shader to remake the fog. Unfortunately, I have to use a fog shader for every object in the scene. I also tried using a built in global fog shader on the camera which “worked” as in the fog showed up on the mobile device, but it was barely customizable to the point I couldn’t even change the color of the fog from gray. At some point I may attempt to make it a shader for the camera, which would involve me checking the z buffer of each pixel and if it’s far enough away away make it fog instead of checking the distance from the camera with each object, so we can use any shader on an object instead of just a fog shader. That’s for another time though. Other than that I made a layout for the new powerups section of the strategy game and have basic code structure for it. At this point it would take me an hour or two to finish implementing them (which I plan on doing before the next meeting with our clients). I also started making my own particles for the game using my shaders and quickly found out there are two ways for getting uvs for a texture in a shader.
One way takes into account texture offset and one doesn’t. Guess which one I was using? The one that doesn’t use texture offsets meaning I have to go back and change all of my shaders if I want to support it. After changing it I got a basis for what I want to do with my shaders currently, but I also want to make it so I can use the same shader for future projects or later on in this one. Pretty much a particle shader needs to support transparency and no culling, which mine does, but I want mine specifically to support multiple textures to make cool particle effects. I got it working with multiple moving textures, but not how I envisioned it. It pretty much displays both textures on top of each other when I want it to display the textures when both line up. It’s simple math, but getting it to work with a 3rd texture for the object and a color tint as well as not having prior experience with particle shaders makes it challenging. I’m sure I’ll get it done in no time, especially now that I have perforce working to get the lectures for particles. Other little things I’ve been working on are the asset list, pushing polygon counts, and getting rid of Unity’s built in skyboxes (these things take up over 10K polygons which could be used for objects in the user’s face instead of distant objects). Unfortunately skyboxes have lighting components which heavily changes some of the scenes. Shouldn’t take too long though, although I now need a custom skybox for my scene since it doesn’t take place in an enclosed environment. That’s for another time though.
Comments