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?
- Viewing Profile: Topics: zacaj
Community Stats
- Group Members
- Active Posts 415
- Profile Views 2,579
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Male
-
Location
NY
User Tools
Latest Visitors
Topics I've Started
How to determine object depth for sorting
16 January 2013 - 12:53 PM
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
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?
- Home
- » Viewing Profile: Topics: zacaj

Find content