Starting to learn CG shader language

lambert-shaded-capsule Over the last few days, I have been learning about the CG shader language for Unity 3D. I started out following a tutorial to make a simple lambert shader, as pictured here. Shaders use trigonometry to calculate the lighting on each pixel or vertex or the mesh.  To find the brightness of a specific area, you can take the dot product of the surface’s normal direction, and the direction of the light you are calculating for.  The color of the area is then found by multiplying the light’s color ( _LightColor0.xyz ) by the calculated shadow.  In CG, this looks like

The attenuation value ( atten ) is used for light falloff, so as a point light gets further away from the surface, it provides fewer lumens.  The brightness variable is then added to UNITY_LIGHTMODEL_AMBIENT.xyz to account for the ambient light in the scene, and then returned as part of the vertex shader function’s output.

 

 

This new knowledge will be useful for the new game I will be working on over the last semester of my senior year in high school for the Computer Game Programming course at Fullerton College.

Updated mobile site version

n5-mobile-layout
Today, I finished the mobile layout for this site today.  It uses pure CSS to make the layout, with a bit of JavaScript to set CSS styles when the user hits the navigation pane expand button (at the top left).  The static styles are set with the following CSS selector

@media screen and (max-width: 899px){
header .top-bar-wide {display: none}
header .top-bar-narrow {display: inline-block;
}

To animate the page sliding to the right to reveal the navigation drawer, I apply a CSS class using some simple JavaScript

document.getElementById('wrapper').className = "slideIn hfeed";

 

 

 

 

 

Below are some more pictures of the mobile site.

Screenshot_2014-03-07-21-07-28Screenshot_2014-03-07-21-06-14
Screenshot_2014-03-07-21-08-28

LimitlessLED Wi-Fi controlled light bulbs

E27-LED-Light-BulbAbout a week ago, I received a LimitlessLED RGBW Smart-Light from LimitlessLED. This light bulb can be controlled over a Wi-Fi network with UDP hex commands.  Unfortunately, the C# program for controlling the bulbs was using an old version of the codes, so it did not work with my bulb.  The source code for their controller program is available on Github, so I decided to fork their project and push my own commits to fix the issues.  My version is available at https://github.com/dudeofawesome/LimitlessLED.

Indexer 1.1b5 released (Last change to Indexer for the year)

Today, I released Indexer 1.1b5, which included bug fixes.  My plan for the next few releases is to work on converting the preview system to using MIME types instead of extensions for identifying previewable files.

Indexer 1.1b4 released

I released Indexer 1.1b4 to Github today.  In this update, I the fixed watermark / QR code not appearing properly on link hover.  Now the images mesh properly with the striped background pattern.

Indexer 1.1b3 released

Indexer 1.1b3 includes various bug fixes and feature implementations.  Pictures now show loading progress properly, middle clicking on an item in the file list now opens the file in a new tab, the page’s URL updates to reflect tab new item being previewed which allows users to send links to a preview page.

Expect more features and bug fixes coming soon.

Indexer 1.1b1 released

Indexer 1.1b1 was released today. This update makes it possible to protect specific folders from anonymous viewing via a password.  To prevent a user from having to re-enter their password every time they change pages in a protected directory, Indexer now uses a PHP session to keep track of the user’s viewing permissions.

I am aware of the rendering bug with the <fieldset> tag for public file uploading and will be fixing it in the near future.

Indexer 1.0 released to Github

Today I released Indexer 1.0 to Github.  Indexer is a file explorer program, similar to Windows Explorer or OSX Finder, but for a web server.

To learn more about Indexer, you can visit http://0rleans.com/projectDownloads/Indexer/ and it’s Github page.

Photos from trip to beach

I took these on a trip to the beach with some friends. I like the noise in the barge picture, it makes me think of pointillism.

Pictures from Arches National Park

I took these pictures on a family trip to Arches National Park. To say there’s some really impressive rock structures is a real understatement.