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 / DarkClouds reflection , refraction , ambient light with stars demo

Author
Message
EDGECOM
19
Years of Service
User Offline
Joined: 7th Sep 2006
Location: US
Posted: 21st Mar 2013 23:34 Edited at: 21st Mar 2013 23:46
well I have been working on this for about 2 weeks now off and on a few hours a night

before I get started let me just say I am glad to give some code back to the DBP community and I hope everyone enjoys it.

the star overlay is not broke it works the way I want it to for my game if you wish to change it you will need to mess with the shader
code to much stuff to talk about just download it and mess with it.





Almost forgot this requires the latest dark clouds plugin
EDGECOM
19
Years of Service
User Offline
Joined: 7th Sep 2006
Location: US
Posted: 22nd Mar 2013 19:53
well if people are interested I have updated the shader so that it will not draw stars in front of the closest planet aka the moon

I also forgot to mention in the first post you can change the direction in witch the stars move and how fast they move.

use the following in DBP after you have loaded and applied the effect

example:
SET EFFECT CONSTANT FLOAT 1,"StarDirectionLR",-0.001000

the above example will make the stars move to the right and if you set it to 0 they will not move.

here is the updated shader code just copy paste

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 23rd Mar 2013 10:31 Edited at: 23rd Mar 2013 10:39
Great work; I don't have DarkClouds but can still run the shader. It's a good technique.

I will use it and stick your details in the credits and will probably need to hack up your wonderful work and add layers of mist and get it to work in my game without DarkClouds due to not being impressed with it, but stay tuned to the thread via my banner because I will use it in the next update post currently being published.

EDGECOM
19
Years of Service
User Offline
Joined: 7th Sep 2006
Location: US
Posted: 23rd Mar 2013 15:30
thank you I am glad you like the shader and there are more commands in the shader you can call from darkbasic

they are all floats

rem fades the star layer with the color layer and will show more or less stars
StarMultiplier

rem will make the stars move up or down
StarDirectionUD

rem changes the diffuse blend color color will give it a foggy look
AmbiantSkyColor


also have you looked at evolveds shaders he has a nice collection and a TOD sky system and if you can't find it I think I have deep in the bowles of my hard drive

http://www.evolved-software.com/board/

almost forgot if people need I can post the code for the proper sync order to render darkclous ,blitzwerks terrain and darkimposters using evolveds waters shader
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 23rd Mar 2013 15:37
Oh I definitely know about Evolved's shaders, been using his shaders, tools and examples ever since I started using DBP; but I like what you came up with.

EDGECOM
19
Years of Service
User Offline
Joined: 7th Sep 2006
Location: US
Posted: 23rd Mar 2013 17:42 Edited at: 23rd Mar 2013 17:47
I just want to show you some screen shots of my game using darkclouds it looks good for what I need





Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Mar 2013 06:06
Just as a side note, you probably shouldn't see stars in front of the moon.

"You're all wrong. You're all idiots." ~Fluffy Rabbit
EDGECOM
19
Years of Service
User Offline
Joined: 7th Sep 2006
Location: US
Posted: 24th Mar 2013 17:00
The reason I want stars in front of the moon is there will be no moons in my game just planets in theh sky.

The reason you see stars on the clouds is because the moon color is black no light reflecting off the clouds = no ambient light.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 24th Mar 2013 21:18
Nice work.

I get the feeling Phaelax is talking in relation terms. From the naked eye, a moon or planet must be in front of stars because a star could never be closer to the eye than a visible planet which are generally thousands of times smaller. Assuming that is planet earth, the only star that could be seen to cover over a planet is the sun. Even distant planets could not be seen in front of a star because not only are those planets too small, they do not illuminate.

Quote: "there will be no moons in my game just planets"


That's a shame, the moon itself looks pretty good.

EDGECOM
19
Years of Service
User Offline
Joined: 7th Sep 2006
Location: US
Posted: 26th Mar 2013 19:45
well I have updated the shader and have added SkyR, SkyG and SKyB for better deffuse I have also updated the skyblend (the color compare).






the new values are float here is a simple way to convert between float and dword.

DWORD to float is: dword value / 255
FLOAT to dword is: float value * 255

same as before just copy paste

Login to post a reply

Server time is: 2026-07-11 14:52:31
Your offset time is: 2026-07-11 14:52:31