[Effect] Normal Map Extended 1.01 (Updated -13 Jul)

1 favourites
From the Asset Store
A template which allows you to customise the controls of your game.
  • I'm liking the possibilities that this could open up.... Especially if you can achieve more than one light source - good luck!!

  • I'm liking the possibilities that this could open up.... Especially if you can achieve more than one light source - good luck!!

    To add multiple lights seems is:

    vec3 Sum = vec3(0.0);
    for (... each light ...) {
        ... calculate light using our illumination model ...
        Sum += FinalColor;
    }
    gl_FragColor = vec4(Sum, DiffuseColor.a);
    [/code:3ee92w1k]
    
    I will try to do tonight, but i don't know how the hell pass the variables for every light to C2, i guess for every light i will have to create their own float uniform and ther own variable and pass like LightA, LightB, LightC for each one   , this mean a lot of work XD
  • BAM! Multiple Lights!

    Here the video:

    https://instagram.com/p/5Ac5TUALyb/

    Used one for the player and other for the mouse as lantern.

    Stucked more than an hour in the fucking "for" after get one light working was simple touching some variables until get the second light working.

    Only passed 3 variables for the light2 X/Y/Z for the rest uses the same atributes than the light1. Tomorrow with time and calm i will organize the .fx and .xml to add 3 lights that i think will be enough for now. If i discover how the "for" works and the xml allows maybe i can give the decision to the user how many lights use.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ok, i get 3 lights working, in total about 40 variables to adjust XD

    Here an image of 3 lights wotking at the same time:

    I have to organize to see all correct and the people can understand all well. Also i have to find some way in the .xml and .fx to set active what lights the user want and make it individual for each texture to get maximun personalization, but still i don't know, actually the three lights are always activated :S .

    Yes, everyboy can set to 0 all the properties of the other lights and done, but if you want to test and enable/disable a light can be frustrating. The idea is made something in the .xml/.fx , if not i guess i can add a parameter with nothing to add whathever and from C2 simple say: Is Parameter X set "yes" ? set effect bla bla bla...

  • really nice job

  • Great work

  • Normal Map Extended v1.01 (Multiple lights added)

    Download v1.01 (Includes the effect and demo .capx)

    https://dl.dropboxusercontent.com/u/659 ... d_v101.rar

    Live demo:

    https://dl.dropboxusercontent.com/u/659 ... index.html

    Instructions inside the .capx file.

    Every light is individual for each texture, so you can enable/disable from the parameter "Light State" 0=Off / 1=On . For example in case i want the lantern light only appears on walls, not in the floor, no problem, i disable for the textures i not want to show and ready!

    -

    The next to test is the spotlight, to deform the light depending from an origin point. As always i gill give a try, if works i will update if not i will pass to another thing, that i guess will be try to add some specular light.

    -

    No more, Enjoy!

  • ty so much this is amazing matriax

  • sweeeeet. Thank you so much! Will post my results here

  • Nice, look, your demo worked for me, apparently I opened your capx and I got this:

  • Yes, because in the preview the NormalMaps is over the planets without light for that appears black. When runs, the events set the lights in the mouse and the rotating squares and starts the fun

  • But it's even running in preview as this screenshot.

    Are you saying that should I turn on Light state 1, 2 and 3? if there one is 0, it turns black, is that normal?

  • Ops! i understood you wrong, if you run my .capx have to work like the screnshots without touch nothing.

    So, you are running my example and this is how look? In all sites? NW.js, browsers,etc... ? Livedemo also looks wrong?(https://dl.dropboxusercontent.com/u/659 ... index.html) Arggg!

    Try this:

    Open the: NormalMapExt.xml

    Search this line:

    <blends-background>true</blends-background>

    Change to false like this:

    <blends-background>false</blends-background>

    Close C2 and open again ¿Works now? .

    Edit: I updated the .rar file with the .xml changed and the .capx file updated with the third light. You have to see the yellow and red square 2 lights and other that will be pointed in the cursor/mouse.

  • matriax Sorry for late, sometimes I log out after posting here.

    I've changed from true to false in <blends-backgrounds>

    and reopen .capx, I still get same result as black planets.

    I downloaded your .rar, and opened .capx it showed an alert window that I'm missing normal mapping effect from Gizmodo and I run capx without this effect, then I got

    But apparently, I run with another layout, I got this

    I noticed you used 1 for all light sources, there no point to make them 0 because they will become black, also please bring this

    <blends-background>true</blends-background> back because it can render in editor.

  • LOL! Please restart your computer and try again , this is so weird.

    BTW, the star effect appears in the other screenshot, so if now not appears maybe you made something wrong or your WebGL exploded XD . Also in the main post therse is the version 1.0 and 1.01 links, thw two works bad?

    Gigatron I choose you! This man is killing me! haha.

    Now serious, Rest of the people works correct?

    Edit: Joannesalfa Can you send me your .capx that works correct to see the difference?

    Yes i use 1 to all light sources because with that i can use various lights in the same texture and is like works. ¿? If not how can you get varios lights working in the same texture without enable them ¿?¿?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)