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 / 3 Terrain shaders with example!

Author
Message
Lucka
20
Years of Service
User Offline
Joined: 1st Oct 2004
Location:
Posted: 16th Jun 2008 21:23
Lucka, but not Lucky..

The "final" version is now:



There must be all the necessary.. but still not running properly, the object disappears.

Did you try it out?

Gardening? not a bad idea!

Lucka - gawteam coder - www.gawgames.com
Lucka
20
Years of Service
User Offline
Joined: 1st Oct 2004
Location:
Posted: 16th Jun 2008 21:37
I'm HAPPY!!!

Find out the problem!!

lack of one line here:




This one was out:

float3 Normal : NORMAL;

That was the missing float that stop the effect from working properly..

Now, I'm looking for LightRange, but it's another story

Thanks a lot Dark Coder and Green Gandalf for the help (and the great .fx, DK)
You teach me a lot of stuff for shaders creation!

Lucka - gawteam coder - www.gawgames.com
AtomR
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 23rd Jun 2008 12:43
I'm playing around using the Texture Blended Terrain method and am wondering if it is possible to add lightmapping to that method. I have no clue how to write shaders and would like to know if there is any method that wouldn't require any change made to the shader.

I can't see how it could since all 8 layers are already in use but maybe someone out there knows better ^^

Take care
AtomR
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 23rd Jun 2008 13:17
All the texture stages may be used up, but the channels they have aren't all used, a simple way to add it which only requires the alteration of one line in the shader would be to change 'BaseMap.rgb *= IN.Diffuse;' in the pixel shader to 'BaseMap.rgb *= IN.Diffuse * LayerMap2Map.b;'. Then to add a lightmap, just store it in the blue channel of your second mask image, or the LayerMap2.dds as in my example.

AtomR
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 23rd Jun 2008 13:59 Edited at: 23rd Jun 2008 14:04
When I was typing my question I was actually thinking that since the the blue component of the second mask layer isn't used, it could be used to store that info but since I didn't know how much the shader had to be changed nor how to even begin I droped it

-EDIT-

I changed it like you said but for some reason the terrain doesn't show now :/
AH LOL Ofc not. Learn to add ; to the end of the line
Thanks Darkcoder. With this we can easily and fast create more then just decent looking terrains ^^

Take care
AtomR
Beast E Gargoyle
18
Years of Service
User Offline
Joined: 15th Feb 2007
Location: Sunny San Diego, CA
Posted: 24th Jun 2008 20:57
This looks really impressive. I look forward to trying it out when i get some free time.

All the best,

Beastegargoyle



The Last Great Swordsmen a 3d hack n slash http://forum.thegamecreators.com/?m=forum_view&t=124414&b=19

Login to post a reply

Server time is: 2025-08-09 01:39:33
Your offset time is: 2025-08-09 01:39:33