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 / Annoying object color problem

Author
Message
LiamBradbury
12
Years of Service
User Offline
Joined: 28th Apr 2011
Location: Manchester, UK
Posted: 23rd Jul 2015 06:50 Edited at: 23rd Jul 2015 06:54
Why is that whenever I color an object using the color commands, the color is really dull, but if I then save that object as a .dbo file and load it back in the color is fine?

I need the color to be the same brightness as the loaded version.

I've wrote this short code to demonstrate.



www.liambradburymusic.com - professional music for your games.
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 23rd Jul 2015 08:36
Try this:

Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 23rd Jul 2015 15:31 Edited at: 23rd Jul 2015 15:35
If you need to colour objects without loading from the harddrive; make use of SET OBJECT EMISSIVE to force colour output, and switch your object fog parameter if you do not need fog effects.

You can also use shaders to handle how you want your objects look. Here is an example of a colour shader

LiamBradbury
12
Years of Service
User Offline
Joined: 28th Apr 2011
Location: Manchester, UK
Posted: 23rd Jul 2015 17:28
but what if the object has different coloured limbs?

www.liambradburymusic.com - professional music for your games.
Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 23rd Jul 2015 18:50
If you need an object with different colours for each limb; colour each limb seperately; or apply the shader to each limb seperately. IF you want to use limb commands, you will find that the Matrix1 plugin provides you with more commands for working with limbs than is available in the vanilla command library.

You can load more than one instance of any shader, thus one colour per colour shader. A useful note about shader applications is that objects and limbs can share the same shader.

LiamBradbury
12
Years of Service
User Offline
Joined: 28th Apr 2011
Location: Manchester, UK
Posted: 24th Jul 2015 00:51
Thanks for your help Chris, but I dont understand that shader code at all. If there was a set limb ambience command then it would be so simple!

www.liambradburymusic.com - professional music for your games.
LiamBradbury
12
Years of Service
User Offline
Joined: 28th Apr 2011
Location: Manchester, UK
Posted: 24th Jul 2015 01:37
I managed to fix it by using...



Now it displays the same brightness as when I load up the .DBO object.

www.liambradburymusic.com - professional music for your games.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 24th Jul 2015 15:49
DarkShader has a Constant Lighting Shader...

Quote: "This shader will use a camera lighting effect making the object shading look the same from any direction"


Using this is very simple, load shader, apply to object[Or Limb], done...

chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 24th Jul 2015 16:15 Edited at: 24th Jul 2015 16:16
Hi there.

We could use instead of a shader a little trick. It could be tedious to do many objects, but really works .






I'm not a grumpy grandpa

Attachments

Login to view attachments
LiamBradbury
12
Years of Service
User Offline
Joined: 28th Apr 2011
Location: Manchester, UK
Posted: 25th Jul 2015 02:44
Thanks guys!, your suggestions are great. I'm making an object creator, so I'm only really working with limbs. I have found a way around it now.

www.liambradburymusic.com - professional music for your games.
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 25th Jul 2015 03:35 Edited at: 25th Jul 2015 04:53
Just too throw in another solution to the problem.

Login to post a reply

Server time is: 2024-04-26 06:14:21
Your offset time is: 2024-04-26 06:14:21