Object shows up white in game mode. Why?

Game Engine, Players & Web Plug-in, Virtual Reality, support for other engines

Moderators: jesterKing, stiv

Post Reply
animats
Posts: 15
Joined: Fri Nov 08, 2002 8:18 pm

Object shows up white in game mode. Why?

Post by animats » Sat Sep 18, 2004 7:40 am

I took an existing game from the Blender Gamekit book, and added a cube to it. I gave the cube a red-colored material, but not a texture. The cube renders properly in Blender mode, but in game mode, it always draws as flat white. It's marked as an Actor, but without Dynamics, so it's a fixed obstacle.
In game mode, it works properly as an obstacle, too. Collisions work.

What am I missing? This has to be something obvious, but I'm not finding anything useful in the Blender Gamekit book. Thanks.

ideasman
Posts: 0
Joined: Tue Feb 25, 2003 2:37 pm

Post by ideasman » Sat Sep 18, 2004 7:48 am

Set the light flag in face mode, then do a 'Copy Facer Mode'
make sure there is a light in the scene that is on the same layer as the object.

animats
Posts: 15
Joined: Fri Nov 08, 2002 8:18 pm

Post by animats » Mon Sep 20, 2004 10:18 pm

OK, did that.

Now it renders black in game mode. Renders fine in object mode or in the renderer.

I've tried the simplest scene possible: one cube, one lamp, one layer. Same problem.

There's only one layer, and the cube and lamp are both in it.
All faces have been selected for "light".

I've tried all the types of lamps. The best I can get in the game engine is a little lighting near the corners if I turn on "Smooth". It's as if everything is being rendered with specular lighting only. Everything looks fine in 3D view or the main renderer. It's strictly a game mode problem.

Obviously, I'm doing something wrong. But what? The two pages on lighting in the GameKit book aren't too helpful.

I know OpenGL and its limitations; that's not it.

Using Blender 2.34. Windows 2000. NVidia GeForce 3. Existing games run fine; it's not a setup problem.

animats
Posts: 15
Joined: Fri Nov 08, 2002 8:18 pm

Post by animats » Mon Sep 20, 2004 10:19 pm

Actually, it's not just game mode. Somehow I messed up my material settings.

More later.

OTO
Posts: 60
Joined: Wed Oct 16, 2002 8:51 pm
Contact:

Post by OTO » Tue Sep 21, 2004 5:25 pm

Hello

You must assign texture or colors to you objects with the UV texture editor

Here's a little tut:
http://otothecleaner.free.fr/tutorials/ ... el1-1.html

Please, post questions like this at the http://www.elysiun.com forum
Bye

animats
Posts: 15
Joined: Fri Nov 08, 2002 8:18 pm

Post by animats » Sun Sep 26, 2004 5:00 am

It also turns out that you have to turn on vertex coloring (object mode -> VertCol) before the game engine will use material info. This is not documented in any obvious place in either the Blender 2.3 Guide or the Blender GameKit book.

animats
Posts: 15
Joined: Fri Nov 08, 2002 8:18 pm

Post by animats » Mon Sep 27, 2004 8:58 am

On a related note, is Alpha implemented for nontextured materials in the game engine? Neither the Alpha nor the Transparency sliders seem to affect what shows in the game engine.

(One would expect that since alpha channels in textured images work, alpha would also work for nontextured materials. But apparently not. Is this is a bug?)

Doogs
Posts: 41
Joined: Wed Oct 16, 2002 1:16 am

Post by Doogs » Mon Sep 27, 2004 2:41 pm

You're mixing up materials window with gameblender. It only uses uvmapping.

RonC

z3r0_d
Posts: 289
Joined: Wed Oct 16, 2002 2:38 am
Contact:

Post by z3r0_d » Mon Sep 27, 2004 5:11 pm

animats wrote:On a related note, is Alpha implemented for nontextured materials in the game engine? Neither the Alpha nor the Transparency sliders seem to affect what shows in the game engine.

(One would expect that since alpha channels in textured images work, alpha would also work for nontextured materials. But apparently not. Is this is a bug?)
have you tried the colA object ipo? [don't forget to set the colR colG and colB ipo channels as well]

well, you probably still need an image for that, but you can use just a white one

animats
Posts: 15
Joined: Fri Nov 08, 2002 8:18 pm

Post by animats » Mon Sep 27, 2004 7:33 pm

(removed dup)
Last edited by animats on Mon Sep 27, 2004 7:39 pm, edited 1 time in total.

animats
Posts: 15
Joined: Fri Nov 08, 2002 8:18 pm

Post by animats » Mon Sep 27, 2004 7:38 pm

Doogs wrote:You're mixing up materials window with gameblender. It only uses uvmapping.

RonC
Actually, you can have an untextured material show colored in the Blender game engine if you turn on vertex coloring. Unclear whether this is a bug or a feature.

The documentation is vague on what is implemented in this area. The GameKit manual doesn't come right out and say "untextured materials don't work in the game engine". And they do sort of work.

There are some other confusions in the UV area, which can result in a Blender rendering of the object and the game engine display having different UV alignments. Apparently, not all the UV controls affect the game engine.

Perhaps there should be a "game mode", which turns off all the Blender editiing features that don't work in the game engine. When you turn on "Actor" for an object, that tells Blender it's a game object. All the buttons that won't work on it should then be hidden, or greyed out, or locked at standard values. Something for the "new interface" people to think about.

Failing that, there should at least be clear documentation of what currently works in the game engine.

Thanks.

Incidentally, we're building a robot laser rangefinder simulator in Blender, so we'll be at this for a while.

John Nagle
http://www.overbot.com

Post Reply