Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 02 Jul 2008
Offline Last Active Jul 18 2015 05:00 PM

Posts I've Made

In Topic: Clickable custom-shaped area

22 February 2011 - 04:01 PM

Maybe this is the same as region from bitmap, but could you just see what color is under the mouse, and have a different color for each region?

In Topic: Problem getting SDL application to run properly

18 February 2011 - 03:56 AM

However, when I try to do the first lesson I type this into the main file (SDLmain.h):

Should it not be in a "c file", as in SDLmain.c?

In Topic: 1 decimal point floats

15 February 2011 - 08:24 PM

I think your idea of storing the number * 10 should work, but you may need to use round() instead of the cast?

In Topic: Resources for writing a software renderer?

15 February 2011 - 05:46 PM

I use to love the tutorials at 3D coding Blackhole

In Topic: Mouse picking with GLSL

13 February 2011 - 05:24 PM

I thought that this way would be easier, as it only needs to do the picking when the user clicks (so speed is not an isssue), and I already have all the rendering code, whereas I do not have any ray collision code.

Anyway, I got it to work with a hack that I hope will not result in any nasty artifacts...
I pass the IDs of the object to the shader as uniform integers, and scale them between 0.0f and 1.0f by dividing by 255.0f
fragColor = vec4(playerId / 255.0f, entityType / 255.0f, entityId / 255.0f);
Will this result in any nasties?