Archive for the ‘C#’ Category

Shader Based 2D Shadowing

Sunday, August 15th, 2010

Those who know me know I used to do quite abit of development in c# using Microsoft’s XNA platform.

Well I like to check back in every now and then with some of the big players in the community to see what’s going on.

One of those players is Catalin Zima, who is famous for producing many great shader and effect samples.

One of Catalin’s reccent project particularly caught my eye however as I had tried to tackle the same problem several years ago when I was in my final year of university. That is, Dynamic 2D Shadows Calculated on the GPU (http://mikecann.co.uk/university-projects/shadowshader-in-rendermonkey/)

Catalin’s approach to the problem is far more elegant that my brute force iterative approach. He uses a clever technique of distorting the desired casting image about the light in such a way as not to require iterative pixel lookups.

If you are interested in the more details in the technique I encourage you to check it out over on Catalin’s blog: http://www.catalinzima.com/2010/07/my-technique-for-the-shader-based-dynamic-2d-shadows/

Tags: , , , , , , ,

Windows 7 Taskbar Monitor

Sunday, March 14th, 2010

Well this will learn me!

A while back, I had an idea for a very simple application that would sit in your taskbar and give you at-a-glance performance info about your system, similar to iStat Pro for OSX. This weekend I finally had time to clean up the code up for release.

The problem is that while looking for a couple of images for the app I happened to stumble across Taskbar Meters, which is pretty much the exact same idea I had. Looks like he has made a better job out of it that me too :P

Ah well, I have decided to release my version of the app nonetheless:

You can open the app multiple times and set each one to monitor a different value:

I have also decided to post the source up on google code: http://code.google.com/p/win7-taskbar-mon/

Anyways you can grab version 0.1 here: http://win7-taskbar-mon.googlecode.com/files/Windows7_Taskbar_Monitor_v0.1.zip

Tags: , , , , ,

On the Bleeding Edge

Wednesday, February 10th, 2010

Well it thought it was about time I did some posting about my personal project im working on at the moment as I havent spoken about my coding for a while.

For a while now (alot longer than I had hoped for) I have been working on a project that falls outside the realms of my usual kind of games-related projects. Im not ready do describe exactly what it is yet but im excited about it.

For months I have been struggling with the techinal challenges the project has entailed and I have dabbled with many new and highly diverse technologies including JavaFX (Java), Qt (C++) and Mono (C#).  I have been looking for a cross-platform technology that will get the job done that I need and doing it in an elegant manner.

I thought I had found it with a combination of JavaFX and straight Java using the PureMVC framework. I however was plagued with problems throughout with Bonjour, jGroups, JmDNS, JNI and JNA.

So after months of work, hardship and struggles I read a very interesting article on the up-and-coming Adobe AIR 2.0  that was opened for beta in December. With 2.0 Adobe are bringing NativeProcess  to Air. What this means is that you can you can execute native code (.dlls, .so, .jar etc) from Air. To me this was bloody brilliant as I had been playing with Air reccently and my day-job heavily involves Flex and I simply love the power and beauty of Flex.

So what this meant to me was that I could write the bulk of my project including its interface in my much preferred Adobe Flex (Air) and then use Native Process to communicate with a small kernel of Java that would do all the dirty work that Air itself cant do.

So after a little playing with Flerry for Air->Java bridge I started to think about the structure of the code and the framework I would use. For my initial few runs at this project I had been using the Java version of PureMVC. I really like some aspects of PureMVC but I think its can be so overly cumbersome in some circumstances (ill write another post on this in the future I think). So instead I looked at the alternatives.

I have been using Mate alot recently at work and on my own mini-project the Audio Book Organiser. However as this project is partly for my own learning and personal growth I decided to look at what else there was out there. From the videos by Jessie Warden I had heard about Robot Legs. Apparently this framework has been around for a while, but it was the first I had heard of it. Taking at look at it I immediately became very excited as it looks like it offers all the things that make PureMVC great but without the extra coding-baggage that goes with it.

To add to my interest it appears another very interesting, very new action-script technology has been introduced into Robot Legs called Signals by Robert Penner. Signals is an alternative to the standard events dispatching method found throughout flash (more on this in another post).

So why have I called this post “the bleeding edge?”. Well Adobe Air 2.0 is still in beta and has only been for a month or so. Its so new that some parts still havent been documented atall and the only way to find out how they work is to post a msg to the devs on the forums. Signals is also new and its integration into Robot Legs is very new indeed (last coupple of weeks). So at the moment I feel as if im at the forefront of some very new, very exciting technology, a stark contrast to my fiddlings with the ancient Java.

I realise this post is very text and tech-heavy but I needed to post about it before I forgot all the pain I have gone through with this project to get where I am at the moment. Future posts ill be delving a little deeper into some of my experiments with these new technologies ;)

Tags: , , , , , , , ,

Flash Develop Plugin: Go To Definition

Monday, May 11th, 2009

Go To Definition
I love the Ctrl & click feature in Eclipse/Netbeans and the Go To Definition feature in Visual Studio and have decided to implement them in Flash develop. After an evening or so of trying to write this myself I come accross the “ASComplete.DeclarationLookup()” method. To my great astonishment, this does exactly what I want. So thankyou to Philippe or whoever wrote this method and did all the hardwork of the plugin for me ;)

Screenshot

DLL
http://www.mikecann.co.uk/Files/GoToDefinition.dll

Source
http://www.mikecann.co.uk/Files/GoToDefinition_source.zip

Post
http://www.flashdevelop.org/community/viewtopic.php?f=4&t=4722

EDIT:
It appears that the same functionality is built as standard into FD with the use of the F4 key. Oh well, you can still use this as a shortcut ;)

Tags: , , , ,

Highlight Selected Plugin, updated by David Hancock

Monday, May 4th, 2009

This sort of things brings a big smile to my face; I got an excellent email yesterday from a chap named Dave Hancock asking my permission to post an update he had made to my Highlight Selected plugin.

Its an excellent upgrade and brings some extra features that were lacking in my very basic version.

Copy / Paste of his update:

Liked the plugin so much I decided to add a few features! Posting here with Mike’s permission.

Screenshot

Updates
Added 4 plugin setting options:

Highlight Color (Choose a color for the highlight)
Highlight Whole Words (Choose whether to highlight whole words only or include partial text)
Match Case (Choose whether to match the case of the selection or not)
Add Line Marker (Display a line marker next to highlighted text)

No longer highlights white-space characters

Installation
+ Open FlashDevelop, Click Tools -> Application Files
+ Copy the DLL to the “Plugins” directory
+ Restart FlashDevelop

DLL
http://gonegothic.com/files/flashdevelo … ection.dll

Source
http://gonegothic.com/files/flashdevelo … ection.zip

Tags: , , , ,

Proof of Concept: TwittBot

Thursday, April 30th, 2009

Well for the last few evenings I have been working on this little proof of concept. One of my work colleague Ade (@6t8) came up with the idea “someone should make a game that you can play over twitter”. Well after abit of excitement and talk I decided to have a go at coding this idea. Once I had started I realised that it could be possible to do alot more with this, so I decided to make the project a little more generic and turn it into a pluggable bot for automating twitter.

After a few evenings work however I decided that this project was going to take up a bit too much of my time, especially when I had so much other work to do. So I have decided to release what I have done and let other take it and develop it if they wish.

You login using a twitter account:

1

(more…)

Tags: , , , , , ,

XNA Archive

Wednesday, March 11th, 2009

I just realised some of my old XNAGPUParticles project videos have gone walkies. So I have reposted them on youtube. These are my old projects from my final year of uni, binary and source code can be found in the relevant post for each video.

http://www.mikecann.co.uk/?p=163
httpvh://www.youtube.com/watch?v=vxrg1YavBIg

http://www.mikecann.co.uk/?p=169

httpvh://www.youtube.com/watch?v=3wdIiCCAb9U

I have another reason for these old re-posts, something a little more flash orientated.. Stay tuned for more info ;)

PlaceEd 3

Sunday, February 3rd, 2008

Recently I have been working on some small tools for the lads at work to aid them in designing mobile phone games.

One project I have been working on for a while (in my spare time at work and in the evenings at home) is a new version of PlaceEd. PlaceEd is a small app used by people at work who need to design levels with objects and paths in them.

The reason for making this new version was because the original was starting to show its age and after several modifications to customise it to certain projects it has become unreliable. A second version (PlaceEd2) was half coded by one of the other employees at rockpool though they ran out of time and didn’t complete it.

So that’s where I come in, and I wrote from scratch a new app and called it PlaceEd 3 (even though there wasn’t really a fully released version of PlaceEd 2).
(more…)

XNALiquids 03

Wednesday, January 30th, 2008

Well i was just thinking in work today that it may be possible to detect the bounds of the the particle "clusters" and then line drawing the boundry and then you wouldnt notice the compression that the particles tend to suffer from.

When i got home i tested out my theroy and the results can be seen below. Its pretty obvious that its not perfect but as i say it was just me messing.

Oh BTW grant kot has been working on his polluted planet some more, and its starting to look quite impressive now its over in XNA: link1, link2

XNALiquids02

Thursday, January 17th, 2008

Okay well i have been playing around with my particles AGAIN :P

I started this time from some work done by the CUDA team over at NVidia. As im running windows Vista i couldnt get CUDA to work so i read through the source and adapted it to my needs.

As you can see from the video below its better than my last attempt but still not perfect, it also still runs on  the CPU on a single core and has had no optomisations applied to it.

Hopefully tho i can build on this to make it better.