Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 16 Oct 2001
Offline Last Active May 19 2015 11:20 AM

#5228527 Chaining Pixel Shaders

Posted by on 12 May 2015 - 06:14 AM

Just to elaborate some more, chaining shaders would require you to output to an FBO at each stage, this takes up quite a bit of VRAM if they are RGBA32. Also, keep in mind that you are writing out to a lot of extra pixels for every frame, this also slows things down quite a bit. As mentioned before, it is unavoidable sometimes, like in the case of a Bloom pass, but it should definitely be minimized.

#5199514 Tile Map Editor - Individual Tile editing

Posted by on 22 December 2014 - 07:48 AM

*Obligatory don't do it yourself unless you really have to reply!*


Before you delve into this, have you looked at Tiled (http://www.mapeditor.org/)? It's very powerful and would easily create these sorts of maps with the right tile-set.

#5139024 What is a day like in the life of a programmer?

Posted by on 14 March 2014 - 11:32 AM

I often describe my day simply as such:


40% research/reading

40% conversation

20% coding

#5019991 On a scale from 1 to 10 how bad of an idea would it be to use a JSON like for...

Posted by on 10 January 2013 - 02:19 PM

1: If it's truly turn based, this should be completely fine, and will make life a lot easier I'd say. I've even considering using compressed json strings for packets on real time games just because JSON rocks.

#4985746 Data Driven Game Architecture - examples?

Posted by on 01 October 2012 - 07:38 AM

I struggled with this at first but found the data driven architecture to be quite nice. I have the basic Object class which you can attach any number of different types of attributes too. These include mesh/materials, variables, lights, particle systems, rigid bodies, etc. Attributes are user create-able too so you can attach any number of your own attribute types to the object. These can be used and manipulated in the specific game code, outside of the engine. One other thing you can do is attach a lua script to an object which has the ability to manipulate the object directly. Obviously some things need coded specific to the game itself, but most things can be accomplished with a flexible attribute system. I know this still sounds like a tangle web, but I invite you to just try coding a simple prototype... I think you'll find it easy to get through once you start. My code is on github, feel free to take a look. Here's a starting point: https://github.com/palodequeso/Element-Games-Engine/blob/master/Engine/Game/ObjectAttribute.h

#4985744 As a beginner in Game Programming, I just realized something.

Posted by on 01 October 2012 - 07:28 AM

Agreed on the GUI part. That's why I went with awesomium. I can code my gui in html/js/css which is something a lot of people have lots of experience in.

#4959577 matematics library

Posted by on 16 July 2012 - 07:04 AM

I second glm!

#4954967 is a 16 bit normal map overkill for a 16 bit heightmap?

Posted by on 02 July 2012 - 11:27 AM

Well, it depends on what kind of system configurations you want to support. Do your research and make sure that it's supported on devices that you are targeting. Also, make sure that it is giving you adequate performance for your application. Besides that it's up to you! I encourage you to do the research and try it out. That's half the fun! If you are using opengl or directx, there are definitely performance measurement tools. I will say that in a deferred pipeline it's not uncommon to have 32bits per channel to store gbuffer data, so why not store high resolution normals, I do, it works out pretty great!

#4954183 Assimp Skeletal Animation Follies

Posted by on 29 June 2012 - 09:18 PM

Finally got it... it was this snippet

	    void AnimationState::Update(float frame_time){
		    EG::Dynamics::Animation *animation = animations->Get(current_animation);
		    float animation_duration = animation->GetDuration();
		    animation_time += frame_time;
		    if (animation_time > animation_duration) {
			    animation_time = glm::mod(animation_time, animation_duration);
		    // Traverse Tree and Multiply Aptly, as well as apply Bind Pose Properly
		    std::vector<glm::mat4> unmultiplied_transforms = animation->GetTransforms(animation_time);
		    for (unsigned int i = 0; i < unmultiplied_transforms.size(); i++) {
			    Bone *b = animations->GetBindPose()->GetBone(i);
			    glm::mat4 offset = b->GetOffset();
			    glm::mat4 result = glm::mat4(1.0f);
			    std::vector<glm::mat4> stack;
			    while (b) {
				    //offset = unmultiplied_transforms[b->GetId()] * offset;
				    result = unmultiplied_transforms[b->GetId()] * result;
				    b = b->GetParent();
			    transforms[i] = result * offset;

Before I was using the offset to store the value, but I realized the matrix math didn't work that way...
Inside the while loop it was:
offset = bone_matrix * offset;

Thank you so much for you help! Seriously!!!

And to anyone else stuck on this, always feel free to visit my github project and look at the code yourself. It may not be the best or most efficient, but it's a jumping off point. :)

#4863428 Calculating scissor region for deferred lighting

Posted by on 19 September 2011 - 11:38 AM

I too am interested in a good resource for this, although I think I have a good idea of how to acheive it. Currently I am only using a simple radius check in the frag. However, since doing 3d picking I think I've realized a different approach. If you take the view_matrix (camera_matrix) and the projection_matrix and find the corners of affect like this:

vec4 top_right_light_position = projection_matrix * view_matrix * vec4(light_position.x + light_radius, light_position.y + light_radius, light_posiion.z + light_radius, light_position.w);
vec4 botom_left_light_position = projection_matrix * view_matrix * vec4(light_position.x - light_radius, light_position.y - light_radius, light_posiion.z - light_radius, light_position.w);

You then know the bounds for the rectangle by using x, y, of each corner and can define a scissor rectangle. Although I'm sure there's a much better way to do this, and I haven't yet tested this. Just figured I'd give you some inspiration to get the wheels turning.