# Stainless

Member Since 18 Jul 2011
Offline Last Active Today, 12:18 AM

### Topics I've Started

18 May 2013 - 08:57 AM

I'm struggling at the moment with getting shadows working on OpenGLES 2

At the moment I'm using a depth buffer based technique, but my scene is so big that the shadows end up big and clumpy.

I'm thinking about stencil shadows, but I'm not sure it will work with a huge scene.

Any ideas people?

I started this project two weeks ago and have two weeks left, so I'm very tight for time and can't afford another failed attempt.

### Broadcomm opengles 2 speed issue

13 May 2013 - 10:09 AM

BCM97425

Has anyone worked on this box?

My new renderer runs at 177fps on my old Macbook , and at 205fps on my Samsung Galaxy S3 but only runs at 12fps on this box.

The box has more than enough grunt, so it shouldn't be this slow.

I cannot find any specs on the graphics card other than "1gig pixels per second" but several 2d games run at 60hz when the device is running 1080p and everyone I have talked to says it's a good platform.

I've emails in with Broadcom, but they are always slow to reply and I'm banging my head against a wall and a deadline.

### Opengles 2 GOTCHA

03 May 2013 - 07:45 AM

Was testing my new OpenGLES 2 renderer yesterday, and it completely failed on some devices.

It worked perfectly on everything except Samsung phones and Broadcom set top boxes.

On those devices it displayed nothing. No errors. No exceptions. Just a black screen.

After a lot of playing around I finally tracked down the problem to my shader class.


program = glCreateProgram();

//attach the fragment and vertex shaders to it

glBindAttribLocation(program, 0, "a_v4_vertex");
glBindAttribLocation(program, 1, "a_v4_normal");
glBindAttribLocation(program, 2, "a_v2_texcord");
glUniform1i(sampler_location, 0);



The issue turned out to be linking before binding the attributes, changing the above code to this.


program = glCreateProgram();

//attach the fragment and vertex shaders to it

glBindAttribLocation(program, 0, "a_v4_vertex");
glBindAttribLocation(program, 1, "a_v4_normal");
glBindAttribLocation(program, 2, "a_v2_texcord");
glUniform1i(sampler_location, 0);



Solved the problem. It now runs at 60Hz on all devices, and looks awesome at 1920 by 1080 on the Broadcom box.

It was such a bitch to find that I thought it would be a good idea to post it here.

### Possible game setting (a la Terry Pratchett)

27 April 2013 - 08:44 AM

The universe is in a delicate state of balance in all things, there are plenty of examples of this in science. Centripetal and centrifugal force, for every action there is an equal and opposite re-action, and so on.

What is not so obvious is that this applies to good and evil as well. For every good act, an evil one must occur.

When Mort first found about it, his first reaction was "hell that's obvious! How else do you explain tele-evangelist's".

Then he started to think about history, and realised it had been happening in plain sight all the time.

A man says "hay wouldn't it be good to be nice to one another", so we nail him to a cross.

Advances in farming allow more humans to survive, the plague wipes them out.

Karl Landsteiner classifies blood which allows blood transfusions to save life's, world war one took them back.

The discovery of penicillin saved millions of life's, world war two took them back.

The cure for cancer led to the flu epidemic of 2035 which claimed 20% of the planets population.

And so on through out history.

Then he got the smug satisfaction from knowing that all those do-gooder charity workers bleeding all over the TV screens of the world, asking for your "£2 a month, or whatever you can afford" are actually mother-f*cking baby killers as the universe balances itself out.

So in this universe it is really important to maintain a balance, not that easy to do. If you accidentally save a life, you can't just kill him or her. You go to jail for that.

You have to be careful in everything you do, look to the long term effect, work out the angles, and do as little as possible.

The one thing you must not do, in any circumstance, is something as unbelievably stupid as saving the planet. I mean the universal imbalance that would create would be devastating. It could easily lead to a cascade failure of the whole universe.

So when Mort slammed his space craft into the asteroid destined to destroy Earth after a particularly good party and several too many Pyrozene Dart's, nudging the asteroid into a new safe flight path, he knew he was screwed.

He tried several times to nudge it back into the right flight path, but in his drunken state all he managed to do was plant an asteroid into a crater on the moon.

The next day when the hangover had reduced to merely apocalyptic proportions, the full horror of the situation dawned on him.

It was about the time a holo-reporter broke into his bedroom and started asking terrifying questions like "How does it feel to be the savior of Earth". At least the reporter couldn't use the footage as the question produced a projectile vomiting session of epic proportions. Drenching not only the reporter, his holo-camera, and Mort's bed, but also a passing car.

### Genetic spell system

22 April 2013 - 09:23 AM

I've been thinking about using genetic ideas to create game elements a lot recently.

After all just taking a stream of bits and translating that into interesting game effects without having huge amounts of code is something that would be really cool on mobile devices.

Over the weekend I had an idea which I wanted to get down on paper before I forgot it.

http://stainlessbeer...etic-magic.html

The basic idea is to create a massive range of spells from a few basic genes.

Have a look and see if it's one of my mad ideas, or if it really does have worth.

If we think it's worthwhile I'll do some code for it, though if I do I would like someone else to take my code and generate a devmaster format tutorial from it.

I don't have much spare time, well any spare time, and I'm not a graphic artist.