Game Development Community

Translucent primitives problem

by Mehmet Kizil · in Torque Game Engine · 09/01/2005 (9:15 am) · 2 replies

Ok, i've achieved what I wanted, however I have run into a problem. I've modified SimplestObject to the extent that I have a transparent box that can be added to the scene on call. However, this "translucent" rectangle looks great... in the first screenshot:

http://members.iinet.net.au/~downsyde/screenshott_1.JPG

But then when you hover and rotate around the box, at almost every other angle other than the POV of the first screenshot it looks like this:

http://members.iinet.net.au/~downsyde/screenshott_2.jpg

The colour of the box changes slightly as you move around it aswell. Is it that i'm not declaring normals for my verticies correctly? Any help would be greatly appreciated. For the record, there is a link to the completed code below. Many thanks in advance to anyone that can help me.


CODE: http://members.iinet.net.au/~downsyde/simple.txt

I edit lines in:
void SimplestObject::renderObject(SceneState* state, SceneRenderImage*)
and
bool SimplestObject::render(void)

*edited link

#1
09/02/2005 (5:18 pm)
You have a bad sort type. You have:

image->isTranslucent = true;
		image->sortType = SceneRenderImage::Plane;

This is going to give very messed up results.

Look at tsStatic.cc for an example of how it should be done. (Note it will register multiple images for opaque and translucent parts of the object).
#2
10/17/2005 (3:34 pm)
Ben Garney,

I'm still unable to get this blasted thing to work. Care to help me out? Code would be most appreciated