Jump to content

  • Log In with Google      Sign In   
  • Create Account


Ravuya

Member Since 13 Feb 2001
Offline Last Active Jul 22 2013 11:11 AM
-----

Topics I've Started

FBO MRT questions (Was: FBO/MRT corruption on nvidia)

29 April 2009 - 06:01 AM

On my ATI card at home, I have an FBO with two colour attachments and a depth buffer, and I am writing to gl_FragData[0] and gl_FragData[1] in the fragment shader. I am using glDrawBuffers(2, attachments) with attachments = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1 }. The colour attachments are texture rectangles. It works fine on my ATI X1600 on my Macbook Pro. For some reason, when I am rendering on NVidia cards (on Linux or OS X), the draw into gl_FragData[1] seems to get garbage fragments written into it. I had seen this problem before, but it was because I was writing into one or the other gl_FragData locations and uninitialized garbage was going into the unused one. What is the proper procedure for rendering to an FBO with more than one colour buffer in a shader? On the application side, I am just using glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) after binding the FBO; am I missing a technique for clearing out FBOs properly even though I should be overwriting those texels in the shader? In the below screenshot, the "F" buffers (FDepth and FNorms) are one FBO, rendering the front faces of the object, with two colour attachments (FNorms = gl_FragData[0], FDepth = gl_FragData[1]). The "B" buffers are another FBO, rendering the backfaces of the object, with the same setup. I know the geometry is solid because the first colour buffer seems to work fine. Any help would be appreciated. [Edited by - Ravuya on April 29, 2009 12:20:52 PM]

Maya OBJ export referencing nonexistent texture coordinates

02 March 2009 - 12:20 PM

Hi all, I'm working in a game team this semester and one of my teammates has ginned up a mesh from a polygon surface which I triangulated using the Polygon -> Triangulate tool. There's a lot of problems in Maya 6's OBJ export, such as the fact that some faces reference texture coordinate indices that don't actually exist (there are 1000 or so texture coordinates defined in the file, and the faces reference something up to 2700). I'm assuming this is a side effect of triangulation, but I'm surprised that a tool that costs this much money is this stupid when it comes to exporting meshes. Is there something to look at in Maya for this, or should I just live with it and make my OBJ loader hyper-paranoid?

Tokamak neSensor doesn't seem to work.

19 January 2009 - 03:23 PM

I've chosen to try out Tokamak for a racing game, and so I've looked at the example code, which uses neSensor (presumably a raycast sensor) and tried to implement it on my own. However, the neSensor never seems to actually detect a collision with other rigid bodies (or even its housing body); I've put another rigid body (with collision geometry) under it and it doesn't seem to ever have a collision depth that's not 0. If I put an neAnimatedBody (which is a rigid body that doesn't move) under it, I get a contact with what seems like the correct distance and collided body, but only immediately after the rigid body's geometry has collided with that of the animated body, which defeats the purpose. It seems like I've missed some state because the sensor only "wakes up" immediately after a collision. I have no idea why the sensor doesn't work, and I've tried a few things like turning off the object which owns the sensor's collision geometry. The straight geometry collision works fine, but not sensors. Here's a code snippet, if it helps:
// Bring up the physics core
neV3 gravity = {0, -0.32f, 0};
PhysicsManager physicsWorld(gravity);
// Create a physics body
neRigidBody* target = physicsWorld.AddRigidBody("target"); // calls neSimulator::CreateRigidBody
neV3 targetInitialPosition = {0.0f, -2.0f, -4.0f};
target->SetPos(targetInitialPosition);
target->SetMass(0.6f);
	
GameRigidBody targetWatcher(target);						// wraps it to display some debugging info on screen (boxes)
target->GravityEnable(false);

neRigidBody* dropped = physicsWorld.AddRigidBody("dropped");
targetInitialPosition.Set(0.0f, 2.0f, -4.0f);
dropped->SetPos(targetInitialPosition);
dropped->SetMass(1.6f);

GameRigidBody droppedWatcher(dropped);
dropped->GravityEnable(true);
neGeometry * geom1 = target->AddGeometry();
neGeometry * geom2 = dropped->AddGeometry();

neV3 boxSize;
boxSize.Set(1.0f, 1.0f, 1.0f);
geom1->SetBoxSize(boxSize);
geom2->SetBoxSize(boxSize);

neSensor* sn;
sn = dropped->AddSensor();
neV3 snPos, snDir;
snDir.Set(0.0f, -1.0f, 0.0f); // basically, pointing straight down. If I change this to +/- 9000000, it still doesn't work, so it's not a 'length' issue that I can see.
snPos.Set(0.0f, 0.0f, 0.0f);
sn->SetLineSensor(snPos, snDir);

// Remember to invoke these after changing collision geometry. Also updates sensors.
dropped->UpdateBoundingInfo();
target->UpdateBoundingInfo();


Tokamak seems like it's fine for my needs, but I just have to get over the initial hump (and lack of current documentation). What I've entered there is more or less the same as what they have in the Tokamak car sample. I'm not sure if the length of my sensors should be shorter or longer or what. I'm using a delta timestep, but even with a fixed timestep (1/60.0f) it exhibits the same behavior. It seems the simulation engine is skipping over the sensors altogether even though the neSimulatorSizeInfo says that one sensor is present. Edit: When I impact, the sensor seems to be "off" at an angle; is there something weird here with parallel objects? Do I need to add another box that doesn't respond to collisions in order to do a broad-phase "sweep" before the sensor tries it? If so, that's a pretty egregious miss in the documentation and the example. [Edited by - Ravuya on January 19, 2009 10:47:10 PM]

Happy birthday, Moe and SHilbert and jpetrie!

29 August 2008 - 05:11 AM

Prodigious forum member Moe's year counter incremented today. Tomorrow is SHilbert's birthday. Edit: Yesterday was jpetrie's birthday. Now you guys will have to split this delicious cake: No, stoppit. STOP STABBING THE SCREEN WITH YOUR FORK. [Edited by - Ravuya on August 29, 2008 2:10:34 PM]

Religious? Committing simple assault? Move to Texas!

29 July 2008 - 03:07 AM

Mrs Schubert Pearson, 29, claims she was left bruised and traumatised after members of her church group allegedly kept her captive for two days so they could perform an exorcism in which was pinned to the ground and "pummelled". The thing that really gets me is this random lawyer they talked to about the case:
Quote:
Hiram Sasser, director of litigation for Liberty Legal Institute, a non-profit organisation representing litigants in religious freedom cases, said the separation of church and state prevented government interference in religious practices except in extreme examples such as sexual abuse. And while this might mean "certain harms may go unaddressed", he said, "the larger protection of the church and religious freedom is the overriding concern." Mrs Schubert Pearson's claims were largely emotional and "so interwoven with religious practices" there was no way for a court to get involved, he added. "The government can't get involved in overseeing religious practices. The best way to say it is it's not American.
What a scumbag. I seriously cannot believe this passed a state supreme court and hope it's headed to the federal supreme court. Without trying to make this a religion thread, I completely understand a religion's want to be free from government interference. However, this case is plainly wrong -- even if they could prove that she was infested by demons, if you get it wrong you're sanctioning textbook assault against a teenager. This sets an incredibly bad precedent.

PARTNERS