About3DArtTechArt Projects

Link to CV / Resume

XNA engine / WPF editor

CLICK TO EXPAND FOR DETAILS

Description

This is both a game engine and a game editor I've written in C# with XNA and WPF. The engine is component based like Unity Engine. The editor uses MVVM design approach (Model View ViewModel).
MVVM means decoupling the UI and the logic to maintain the code easily and do unit testing, also allows the designer to work independently from the developer.

______________________________________________________________________________________________________________________________

View in this case is the XAML code that builds the UI, basically what you see when the software runs.

ViewModel
is all the C# code that runs the functionality and stores and processes all the data. It's basically a mirror of the View (the UI) that can run standalone

Model
is the actual data that the ViewModel interprets and shows in the View such as a material or a texture.

______________________________________________________________________________________________________________________________

The communication between the View and the ViewModel is done through the feature called "data binding" that ships with WPF, but also with alot of user developed extensions to make MVVM easier.

The final "game" is built using the MSBuild class to generate a visual C# project in memory and compile:



There is so much I could write about this tool. This is propably the project that I have learned the most knowledge in a short amount of time compared to all my other projects.

Coded my own propertygrid, assetmanager etc. The part that I'm most proud of is the shader importer. It scans the .fx file and creates a C# class that has getter and setter methods for all the shader constants. It also checks for engine used semantics for lights, matrices and fills the method SetEngineParameters(...) and SetLightParameters(...) that are inherited from the IShader interface. Once the C# file is generated it compiles it at runtime so it can be used in the engine :)
When building out a game, it already has the C# file so it just includes it in the memory generated Visual C# project and compiles it :)

Rendering pipeline

Note: OPTIONAL means can be set on or off!

Update active objects
Camera frustum culls octree nodes
Camera frustum culls objects that are left but outside screen (OPTIONAL)
Engine fills ZBuffer early on with Front to Back sorting (OPTIONAL)
Drawing with 3 possible settings (OPTIONAL Occlusion Query culling)
       1. Sorts and batches material / renderstates wise and loops inside the effect pass and does the drawcalls
       2. OR Uses the order left by the ZBuffer sorting
       3. OR Uses the order from the scenegraph
Handles Transparent objects back to front


Further development

I've been working on integrating a light prepass renderer as a deferred rendering solution.
I'm also working on integrating Hardware instancing with Shader Model 3 (extra vertex buffer holding the transformation matrices)

I'm working on this whenever I have time, engine development never stops =}

 

 

 




__________________________________________________________________________________

Maya Rigging tool

CLICK TO EXPAND FOR DETAILS

Description

This is a Mel script driven automatic rigging tool.
It supports arbitrary number of legs and arms. Also arbitrary number of spine segments.

Before writing this tool, I made myself a BIG library of helper functions to make rigging easier and to keep my code clean and understandable.

HelperJointBetweenLoc(string $loc0, string $loc1, string $name0, string $name1, string $chain)
is an example, where it takes two locators, two joint names and a string that can be any of these three possible words: START, LINK, END, to create a chain of joints.

Once the library was finished I started reusing my own functions to build this auto rigger. Having made myself a library of helper functions allows me to customize it VERY easily and expand on other areas or update some parts etc

 

 

 

Further development

I'd like to redo the functionality of the tool, and make it more modular in the future and also convert the entire thing to PyMEL. But time is money and I am short of time right now!






 


__________________________________________________________________________________

Texture based HLSL blend shapes

CLICK TO EXPAND FOR DETAILS

Description

This is a HLSL shader driven blendshape tool.

The tool is written in both Mel Script and C++ Maya API. The generation is done in mel script while the texture is saved through a plugin with the Maya C++ API.

It loops through every vertex of the base mesh and computes the delta vectors and the linear magnitude in [0, 1] range as weights and packs them to a texture.

While generating the information it also creates a second UV set. If a vertex has not changed at all it is placed at the last pixel coordinate, else they are lined up horizontally. This is an optimization which makes unchanged vertices to point to the same pixel and thereby allowing very dense meshes to be morphable.

Imagine a character with 10 000 vertices, but only 250 of those vertices are edited through all the morph targets. Instead of storing 10 000 delta vectors, this allows us to store 250 delta vectors and all the other unchanged 99 750 vertices point to the last pixel in the texture.

The shader uses the newly generated UV coordinate to lookup the newly generated texture to compute the displacement in object space, allowing the object to be scaleable, rotateable, translateable.


Further development

Ideas to expand on this tool could be such as using a 128 bit A32R32G32B32 DDS textures to encode in useful information, and
decode them back in the shader with a single vertex texture fetch. Example:

R32 channel = new Normals xyz
G32 channel = new Tangents xyz
B32 channel = the Deltas xyz
A32 channel = the Weights scalar + compensated UVs for stretching xy

the Binormal could then be generated with a cross product after decoding the Normals and Tangents.

The tool could easily be expanded further :)

 

 






__________________________________________________________________________________

CgFX Maya Viewport Shader


Dragunov Sniper artwork was provided by Lina Andersson. Her portfolio: www.linisart.com

CLICK TO EXPAND FOR DETAILS


Description

This is a CgFX shader that runs on the maya viewport. Took me a day to code it from scratch. The animated gif sequences show just a glimps of the features supported by the shader. If you want more information just look at the documentation below :)


3 point Light
Diffuse with energy concervation
Specular
(Blinn, Phong and Ward anisotropy)
Normal and parallax occlusion
Self illumination
Diffusive Convolution and AO map
Blurable Reflective / Refractive cubemap & Fresnel
Refractive Chromatic Dispersion


 


____________________________________________


Documentation 1.0.0.0


Irradiance Shader

The irradiance shader is designed with ease of use in mind. It is built as an all purpose shader that still gives artistic freedom for people to play around with, makes it very suitable for rendering game assets.


Common Attributes

Render mode - scrolls between each material component such as diffuse, specular etc. 18 is final the composition.
Light count - Wether it should use all the lights or not.
Point light # - Position of the point light in the world.
Color - Color of the corresponding light.
Camera position - Position of the camera in the world.
UV tile - Tiling of the UV coordinates of the mesh.

 

 

 


Diffuse Attributes

bUseDiffuseMap - Use a colored diffuse texture or not.
bHalfLambert - Wether it is lambert or half lambert shading.
Energy concervativity - How much light can be absorbed by the surface. Metals tend to have low energy concervativity because they are reflective.
DiffuseSampler
- The diffuse texture.

Normal / Parallax occlusion Attributes

bUseNormalMap - Use a tangentspace normal texture or not.
bUseAlphaAsParallaxOcclusionMap - Use the alpha for parallax.
POM range - amount of parallax occlusion should be applied.
POM shadow softness
- Softness of the self shadow effect from parallax.
POM min samples
- Minimum samples for glancing angles.
POM max samples
- Maximum samples for parallel angles.
NormalSampler
- The normal texture.

Specular Attributes

bUseSpecularMap - Use a colored specular texture or not.
bTrueBlinnFalsePhong - If true Blinn algorithm, else Phong.
bTrueWardAnisotropy - If true Ward anisotropy algorithm.
Horizontal / Vertical Anisotropy - Direction of anisotropic highlight.
Specular intensity - Intensity of the specular highlights including the anisotropic intensity.
Specular exponent
- Glossiness of the specular highlight. Wether it is soft or hard, works only on Phong or Blinn.
SpecularSampler
- The specular texture.

Reflection Attributes

bUseReflectionMap - Use a colored reflection mask texture or not.
ReflectionSampler - The reflection mask texture.
bUseReflectiveCubeMap - Use a cubemap for the reflections.
bInvertReflectiveCube - Inverts the reflective cube so it is upside down.
Reflective cubemap intensity - Intensity of the reflections.
Reflective cubemap blur
- Blurs the sharp reflections.
ReflectiveCubeMapSampler
- The cubemap texture.

Transmittance Attributes

bUseTransmittanceMap - Use a colored transmittance mask texture or not.
Chromatic Dispersion - Index of refraction for each of the R, G, B channels. Controls how much to refract each wavelength. Produces Chromatic dispersion.
Fresnel bias - Additive offset for the fresnel effect.
Fresnel scale - Multiplicative offset for the fresnel effect.
Fresnel power - Exponential offset for the fresnel effect.
TransmittanceSampler
- The transmittance mask texture.

Selfillumination Attributes

bUseSelfIlluminationMap - Use a colored emmisive texture or not.
Selfillumination intensity - The intensity of the emmisive texture.
SelfilluminationSampler - The selfillumination texture.

Indirect Attributes

bUseAOMap - Use a black and white baked ambient occlusion texture.
bUseNormalBlueChannelAsAO - Use the blue channel from the normalmap to create the ambient occlusion.
AOSampler - The ambient occlusion texture.
bUseDiffusiveConvolution - Use a preblurred cubemap for indirect lightning.
bDiffusiveConvolutionInvertDirection - Inverts the blurred cube so it is upside down.
Diffusive convolution intensity - The intensity of the indirect light.
Diffusive convoution blur - Blur the cubemap manually.
DiffusiveConvolutionSampler - The preblurred cubemap texture.