Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

zacaj

Member Since 18 Sep 2008
Offline Last Active May 09 2013 03:25 PM
*****

Topics I've Started

How to determine object depth for sorting

16 January 2013 - 12:53 PM

For transparency rendering you're supposed to sort your objects by depth, however I'm having trouble finding a good method of choosing each object's depth.  Just using the position doesn't work for objects that aren't centered, getting the center of the bounding box doesn't work much better.  I also tied getting the smallest depth from all six corners of the bounding box, but even that has problems.  Has anyone come up with a good way to do this?


Simulating PS1 "shaky vertices" with shaders

04 January 2013 - 04:04 PM

I'd like to get the game I'm working on to look like it uses an old software renderer, and one of the artifacts I'd like to reproduce is how in many old games (specifically on the PS1, but also many computer games) the vertices would shake slightly.  From what I can find this was because the coordinates were passed from the math hardware to the rasterization hardware in integers.  I tried to produce a similar effect by flooring the calculated positions in my vertex shader:

gl_Position.xy=floor(gl_Position.xy*256)/256;

 

but it doesn't seem to produce any noticable effect unless I lower the 256 down to less than 10, and then it is EXTREMELY wobbly to the point of being unusable.  (I chose 256 because my window is 1024 pixels wide, and the position ranges from -1 to 1 (unless I'm remembering this incorrectly?))

 

Any ideas?


Object orientation/position best storage method

21 May 2012 - 03:13 PM

I have been working on a 3D game engine for fun and at the beginning of development I had the idea to store objects with an abstract "Transform" class instead of any definite type of position/orientation (xyz+quaterion, for example).  This way you could have a normal QuaternionTransform that would be used for most objects, a PhysicsTransform for objects in a physics engine, a OrbitTransform, etc.  All they need to provide is functions that give their current position, orientation (3x3 matrix) and transformation (4x4 matrix).  
This had been working fine until I started working on the in game editor.  I started by coding a "move" tool but after getting everything set up with picking working, etc I realized that this would work horribly with my Transform system.  Any system for moving (let alone rotating!) my objects would have to conform to a single Transform type, etc.  How would you move an OrbitTransform that is relative to another object 10 meters left?  
So my question is, what is the standard method of dealing with this?

PARTNERS