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.

Newcomers DBPro Corner / fx shaders ? how do you write in the colours?

Author
Message
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 28th May 2008 21:58 Edited at: 28th May 2008 21:58
i have yust got some time again to fool around with dbp and started to look in to shaders and are a bit confused about how you write colours there as it aint rgb nr its float type of nr?
it where so long time ago i coded anything so that i feel like an newbi again
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 29th May 2008 16:33
"type of nr"? Colours and generally everything are stored in floats because the values are scaled to a 0.0 to 1.0 range, this is because textures aren't always 32bit ARGB so using a scale of 0-255 would make no sense if you used a 64bit image. However it does make things far easier to work with. To 'write' a colour look at the return value from the fragment/pixel stage, that will be a 4 component float(ARGB).

Login to post a reply

Server time is: 2024-11-25 23:32:46
Your offset time is: 2024-11-25 23:32:46