Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Colouring Objects

Author
Message
cosmos
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 1st Oct 2002 20:12
Hi. Trying to make a plain object and colour it. It stays white. Is this normal?
Code example.
make object plain 1,500,500
color object 1,rgb(200,50,30)
I have also set a variable with the rgb command, that does'nt work either.
Thanks for any help.
exLRT
21
Years of Service
User Offline
Joined: 30th Aug 2002
Location: Belgium
Posted: 2nd Oct 2002 09:19
I encounter the same problem. It seems to be due to the "SET DISPLAY MODE" command. I'm pretty sure you use it in your program. Try to put a REM before this command and you'll be able to color your objects. I hope it will be solved in the Patch 2!!!

Ulric
ASUS A7M266 - AMD Athlon 1.4GHz - 512MB DDR266 - CreativeLabs GeForce4 Ti4600 - Windows XP Pro SP1
Zero
21
Years of Service
User Offline
Joined: 28th Aug 2002
Location: Finland
Posted: 2nd Oct 2002 17:04
I think it's not bound to SET DISPLAY MODE
I have the same problem as well, but I think I know why it happens. I read somewhere that DBP won't color objects that doesn't contain any diffuse data. I tried it with a model and ignored the texture-file located on the same directory by renaming it. The model was loaded, but it appeared to be completely white. Coloring didn't work. SO I loaded the model into 3D-Canvas and applied some diffuse color on it.. saved and tried again.. And it works!

The base problem is that dynamically created objects do not contain diffuse data. I think it will easily be fixed. Strange that texture object command works well in spite of color object doesn't.

The evil plan is now even closer!
- - - - - - - - - - - - - - - - - - - -
Specs:- P3 550 Nvidia TNT2M64, 192Mb RAM
cosmos
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 2nd Oct 2002 17:59
Hi. Thanks both for your help. Set Display Mode made no difference. After experimenting, I found that the Ambient light level affects the colour of an object. By lowering light levels (Set Ambient Light 30 for example) displayed the plain object coloured. However, other objects, particularly if they are 'far' away, only show dimly, so not a perfect solution. For now I think that perhaps colouring your own object & then importing it might be the answer as suggested. Can any of you try colouring an object and then use the 'SET AMBIENT LIGHT 100' command and see if the colour disappears from the object. Thanks for your help.

Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 2nd Oct 2002 18:09
I found this too, I almost fixed it too when I looked at the objects FVF flags (for a loaded object) and found that the FVF_Diffuse flag was OFF, but switching it on only made it look kind of washed out.
The built-in DB objects look much the same (or at least the cube does), there is some colour there but its all washed out. I assume this is due to a lack of diffuse data, as Zero said.
I am trying to decipher the FVF format objects from memblocks at the moment, if I come up with a fix I`ll post it.

Zero
21
Years of Service
User Offline
Joined: 28th Aug 2002
Location: Finland
Posted: 3rd Oct 2002 15:08
I would color objects in DBP by making simple 32*32 texture for them which contains only one plain color.. it works better in the current version, but i'm sure this 'problem' will be fixed in later patches

Also.. GHOSTED objects that are COLORED (not textured) will be white when ambient light is set to 100. When using texture as a color, the problem is solved.

The evil plan is now even closer!
- - - - - - - - - - - - - - - - - - - -
Specs:- P3 550 Nvidia TNT2M64, 192Mb RAM
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 3rd Oct 2002 18:49
Using a texture for a colour is OK (I created one texture with all my colours arranged in order, then used scale/scroll object texture to get the right colour on an object). But untextured objects will be faster.
Oddly (and this shows something ain`t right) I found that on some objects using the command 'convert object fvf 338' (338 being the FVF I obtained for a working object) can make the colours show OK, even when the current FVF of the object is already 338!
Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 4th Oct 2002 08:53
I use a 2x2 image of a single colour, and everything works, but the problem IS a bit irritating.

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM
Richard Davey
Retired Moderator
21
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 4th Oct 2002 16:23
Even in DBV1 an object coloured was far slower than an object textured - even if the texture was just a plain colour.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 4th Oct 2002 16:57
Wow, I never knew that, I suppose I should have done some timing tests.
Well it solves that problem, don`t colour objects, use textures, end of story.

Thanks Rich for the help.
Richard Davey
Retired Moderator
21
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 4th Oct 2002 16:59
That doesn't mean to say that "colour object" shouldn't work though - it should - but what I posted is true! Strange huh?

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 6th Oct 2002 05:57
Solution: rewrite color object command so it automatically generates a 1x1 image of the selected colour and textures the object with that.

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM
Dreamora
21
Years of Service
User Offline
Joined: 20th Sep 2002
Location: Switzerland
Posted: 15th Oct 2002 04:41
hmm ... i think using UV coloring would be faster than the old coloring method too without using 1x1 textures

Login to post a reply

Server time is: 2024-04-24 21:59:15
Your offset time is: 2024-04-24 21:59:15