Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, aliswee), 835 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 1
Page 1 of 19 1 2 3 18 19
Normal-Mapping Shader (The Best @ vsps2.0) #120711
04/01/07 16:31
04/01/07 16:31
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline OP
Expert
xXxGuitar511  Offline OP
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
Here's a great NormalMapping shader compiled at vertex/pixel shader 2.0 using two passes. Download Here!

This shader started from Matt_Aufderheide's NM shader, then passed to Bloodline where he added more light passes, then to William where he added more features, and last but not least to xXxGuitar511 where he optimized, and added some additional features as well. The heart of this shader is its lighting algorithms, provided by Matt_Aufderheide.

The Final product is a NM shader which supports:
- Dynamic Sunlight
- 3 Dynamic Lights
- Static Lighting
- Specular Lighting
- Fog (mostly )
as well as:
- Great speeds
- adjust settings through material
- fully supports scripts "Customize" menu in WED


If you have any requests for this shader, such as adding more light passes, then just post them here. But remember, the more passes you add, the slower the shader will run!


  • Instructions for use:

    Advanced users:
    include <NM.wdl>;

    Beginning users:
    - Open your project in WED, then go to the [resources] tab.
    - Open the main script for your project. By default, this will have the same name as your map.
    - Scroll down a few lines until you find your [included] files. When you find these, at the end of the list, add the line: include <NM.wdl>;
    - Save your script, and then close it.
    - Apply the material mat_NM to the models you wish to have NM on.
    - Your done!


    For this shader to work, you MUST have a NormalMap in the second skin of your model. For a great tutorial on NM, look HERE.

    Note: Dynamic lighting only supports the light color, not direction. Therefore, A direction for static lighting must be "faked". The direction used for static lighting in this shader is the sun_dir.

  • How do you rate this shader?
    single choice
    Votes accepted starting: 04/01/07 16:27
    You must vote before you can view the results of this poll.

    xXxGuitar511
    - Programmer
    Re: Normal-Mapping Shader (The Best @ vsps2.0) [Re: xXxGuitar511] #120712
    04/01/07 16:47
    04/01/07 16:47
    Joined: Nov 2004
    Posts: 7,121
    Potsdam, Brandenburg, Germany
    Machinery_Frank Offline
    Senior Expert
    Machinery_Frank  Offline
    Senior Expert

    Joined: Nov 2004
    Posts: 7,121
    Potsdam, Brandenburg, Germany
    Thank you very much for this fantastic contribution.

    But you forgot to add the shader.

    And if you want to test it then you might play around with my latest contribution that fits perfectly to this contribution:
    http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/740985/an/0/page/0#Post740985

    Have fun!

    Here is one question of mine:
    How does it work with static lighting? I thought static lights do not really exist. They are just baked lightmaps in the level geometry.

    Requests? I have dozens of requests
    I could imagine a specular parallax / relief shader. Or what about multi-texturing for terrains that allow normal-mapping at the same time?

    Regards,
    Frank


    Models, Textures and Games from Dexsoft
    Re: Normal-Mapping Shader (The Best @ vsps2.0) [Re: Machinery_Frank] #120713
    04/01/07 17:01
    04/01/07 17:01
    Joined: Oct 2005
    Posts: 4,771
    Bay City, MI
    lostclimate Offline
    Expert
    lostclimate  Offline
    Expert

    Joined: Oct 2005
    Posts: 4,771
    Bay City, MI
    multitexturing could be real easy, ill see what i can do about adding it.

    Re: Normal-Mapping Shader (The Best @ vsps2.0) [Re: lostclimate] #120714
    04/01/07 17:05
    04/01/07 17:05
    Joined: Mar 2006
    Posts: 2,503
    SC, United States
    xXxGuitar511 Offline OP
    Expert
    xXxGuitar511  Offline OP
    Expert

    Joined: Mar 2006
    Posts: 2,503
    SC, United States
    @Frank_G: Yeah, I saw (& used) your contribution. Thanks, it actually helped me very much!

    BumpMapping on terrains could be very slow. I've already made my own multitex shader (part of a project I'm going to sell), but it doesn't use normal maps. This would be easy to add, I'm just not sure how fast (or slow) it would run.

    BTW: yeah, I did forget to add the link, it's up now. I realized that right after I posted, lol.


    xXxGuitar511
    - Programmer
    Re: Normal-Mapping Shader (The Best @ vsps2.0) [Re: xXxGuitar511] #120715
    04/01/07 17:28
    04/01/07 17:28
    Joined: Mar 2006
    Posts: 2,503
    SC, United States
    xXxGuitar511 Offline OP
    Expert
    xXxGuitar511  Offline OP
    Expert

    Joined: Mar 2006
    Posts: 2,503
    SC, United States
    Here's a few screenshots: Here!


    xXxGuitar511
    - Programmer
    Re: Normal-Mapping Shader (The Best @ vsps2.0) [Re: xXxGuitar511] #120716
    04/01/07 19:58
    04/01/07 19:58
    Joined: Mar 2006
    Posts: 2,758
    Antwerp,Belgium
    frazzle Offline
    Expert
    frazzle  Offline
    Expert

    Joined: Mar 2006
    Posts: 2,758
    Antwerp,Belgium
    TOP contribution Guitar !!
    Btw, thxn for the screenies, it gives the users a good impression of what this is capable
    This all results in a super 3 rating

    Cheers

    Frazzle


    Antec® Case
    Intel® X58 Chipset
    Intel® i7 975 Quad Core
    8 GB RAM DDR3
    SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
    NVIDIA® GeForce GTX 295 Memory 1795GB
    Re: Normal-Mapping Shader (The Best @ vsps2.0) [Re: frazzle] #120717
    04/01/07 20:28
    04/01/07 20:28
    Joined: Mar 2006
    Posts: 2,503
    SC, United States
    xXxGuitar511 Offline OP
    Expert
    xXxGuitar511  Offline OP
    Expert

    Joined: Mar 2006
    Posts: 2,503
    SC, United States
    Ha, thanks Frazzle...

    I'm basing future developments of shaders on the results of this contribution. This shader turned out very well. I was surprised at the speed I got from it. Most shaders I run will make the FPS crawl, with this (in the environment shown), I recieved approx 30-40 FPS. Not too bad for A6 rendering. When used with Sylex or Sphere, it should be great!

    I tried to describe how to implement it the best I could, because every shader topic I read, someone asks "How do I use it?".


    xXxGuitar511
    - Programmer
    Re: Normal-Mapping Shader (The Best @ vsps2.0) [Re: xXxGuitar511] #120718
    04/01/07 20:42
    04/01/07 20:42
    Joined: Nov 2004
    Posts: 7,121
    Potsdam, Brandenburg, Germany
    Machinery_Frank Offline
    Senior Expert
    Machinery_Frank  Offline
    Senior Expert

    Joined: Nov 2004
    Posts: 7,121
    Potsdam, Brandenburg, Germany
    Quote:

    @Frank_G:BumpMapping on terrains could be very slow. I've already made my own multitex shader (part of a project I'm going to sell), but it doesn't use normal maps. This would be easy to add, I'm just not sure how fast (or slow) it would run.




    Yes. Maybe you are right. I just noticed that all new games use normal mapping on terrain (e.g. Stalker does it). Stalker uses Normalmapping on every mesh in the game.

    But anyway. I will try this nice shader contribution with a new scene very soon.


    Models, Textures and Games from Dexsoft
    Re: Normal-Mapping Shader (The Best @ vsps2.0) [Re: xXxGuitar511] #120719
    04/01/07 20:43
    04/01/07 20:43
    Joined: Sep 2002
    Posts: 8,177
    Netherlands
    PHeMoX Offline
    Senior Expert
    PHeMoX  Offline
    Senior Expert

    Joined: Sep 2002
    Posts: 8,177
    Netherlands
    "Note: Dynamic lighting only supports the light color, not direction. Therefore, A direction for static lighting must be "faked". The direction used for static lighting in this shader is the sun_dir."

    Could you make it so that it react to the direction of dynamic lighting? By the way, I've now done some testing and this contribution is top notch, big thanks!!

    Quote:


    Yes. Maybe you are right. I just noticed that all new games use normal mapping on terrain (e.g. Stalker does it). Stalker uses Normalmapping on every mesh in the game.




    Yeah, I'm actually surprised Stalker doesn't run slower because of that. On the other hand the system requirements are huge.

    Cheers


    PHeMoX, Innervision Software (c) 1995-2008

    For more info visit: Innervision Software
    Re: Normal-Mapping Shader (The Best @ vsps2.0) [Re: PHeMoX] #120720
    04/01/07 21:34
    04/01/07 21:34
    Joined: Mar 2006
    Posts: 2,503
    SC, United States
    xXxGuitar511 Offline OP
    Expert
    xXxGuitar511  Offline OP
    Expert

    Joined: Mar 2006
    Posts: 2,503
    SC, United States
    Quote:

    Could you make it so that it react to the direction of dynamic lighting?


    Dynamic lighting uses the position of the dyn light as it should ...

    Only static lighting must fake light direction. here's how it works:
    Static light positions are not stored, only the lightmaps they create. Therefore, to get the color of static lighting, you must simply use traces to get the colors from the lightmap around your model. This shader simply does a downward trace from the origin of the model, and passes the color to the shader. Since we do not know the position, we must tell the shader where to illuminate from. So I decided to use the suns position/angle for this.


    xXxGuitar511
    - Programmer
    Page 1 of 19 1 2 3 18 19

    Moderated by  adoado, checkbutton, mk_1, Perro 

    Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

    oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

    Powered by UBB.threads™ PHP Forum Software 7.7.1