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 / Set Object Diffuse with lights turned off.

Author
Message
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 24th Feb 2013 00:55
Hello, is there a way to alter the color of an object with transparency, which has it's sensitivity to light turned off, without changing the color of it's texture?

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Virtual Nomad
Moderator
19
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 25th Feb 2013 00:04 Edited at: 25th Feb 2013 00:09
sounds like you already found that you lose alpha when blending textures.

meanwhile, is it practical for you to go ahead and leave the light on and set elements to simulate "lights off" via rgb(255,255,255) settings, then rgb(xxx,xxx,xxx) to add the color as needed? ie:



otherwise, depending on the effect, frequency and variey, pre-rendering "colored" textures might be the way to go.

Virtual Nomad @ California, USA . DBPro V7.7 . Matrix1Utils 05.27.12
AMD Phenomâ„¢ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit
Nytus Sermus
12
Years of Service
User Offline
Joined: 17th Jan 2013
Location:
Posted: 26th Feb 2013 20:25
control the objects material properties, if its sensitivity to light is turned off then you wont be able to color its diffuse component, so try COLOR OBJECT and combine it with SET OBJECT AMBIENT to modify its ambient color amount.

You could be done already.....stop trying to re-invent the wheel.
thenerd
16
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 27th Feb 2013 03:22
COLOR OBJECT simply generates a texture with a color on it, so that won't quite work. If I were you I would check out the vertexdata fvf commands as well as the vertexdata diffuse commands. The diffuse color of a vertex will blend with the texture. Here's a quick demo for you. This demonstration generates a texture containing transparency. The object is set up with transparency, and without light. Then, I use the vertex diffuse commands to set the color of the vertices which tints the texture. You'll need matrix1/d3d_func to generate the texture.



Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 28th Feb 2013 00:16
The trouble with the built in coloring commands is that sensitivity to lights needs to be on. This is fine when the light source is behind the camera, but when it's in front of both the camera and said object, the backface receives no light, and so is not visible.

I might try that fvf method, I ended up just creating another texture and recoloring it with the image kit. Not having to create more textures would be better.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
thenerd
16
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 28th Feb 2013 01:48
The one problem with the FVF method is that the vertexdata commands are slow in realtime. But if you only use it once, it works fantastic.

Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 28th Feb 2013 12:13
Have you thought about using a simple shader?
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 23rd Mar 2013 14:26
Thread ressurection! lol

No I hadn't, as my shader knowledge is poor. But I believe I solved it with the image kit plugin.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]

Login to post a reply

Server time is: 2025-05-17 18:22:31
Your offset time is: 2025-05-17 18:22:31