matriax's Recent Forum Activity

  • 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!

  • 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...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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
  • Much thanks for the example but in my case only worked when i changed "on created" by "On start layout".

    I changed my condition of " F_NormalMaps On created" by "on start layout" and is working now. If i delete the condition "On start layout" not works i don't know why :S , but well is solved, thanks! very useful the Pick-Nearest! .

  • Arg! I thought i get it.

    Have in mind that in the game i have multiples tile1,etc... so at the start there is only one Tile1_Normal, is after when all the Tile1_Normal are created due the "container" of each Tile1.

    I say this because i added "F_NormalMaps on created -Z" at i get the last object pinned, but pinned with all the normaltiles XD, seems i'm getting somewhre, i hope....

  • Would this work for you?

    for each family1

    pick nearest family2

    > family2 pin to family1

    Not works or i'm doing some wrong, I made this:

    Is correct? The idea looks very good i really hope this works

    I made various changes about family1/2 and nothing all the combinations fail, not pin.

  • Yes, the tiles are sprites and actually all are using the container behaviour.

    Yes, and all this options works with individual sprites but not on families.

    I mean, i have: Tile1, Tile2, Tile3, Tile4, Tile5 and Tile_Normal1, Tile_Normal2, Tile_Normal3, Tile_Normal4 and Tile_Normal5.

    If on start layout i pin Tile_Normal1 to Tile1 all perfect, allways will go with it on moving or whatever but i will have to add one pin for all the objects i want to move.

    So the idea is add the Tile_Normal1 to the Tile1 container and add Tile_Normal1 to the Normal-Map-Family and use an event or something that pin automatically to all the spritees with a container inside the "NormalMap" family. THen i can add Tile_Normal2 to the Tile2 container and do in the other that always be pinned because that one event/condiction that say they have to be pinned.

    I don't know if i explained well XD . I want to pin all the normal maps over all the tiles adding in their respective container and using only one event/condition instead pin every one 1x1.

  • In my game i'm using normal maps for each tile. Using the container and adding the normal map.gfx no problem always that the tile is static. But when it moves?

    Actually i have something like:

    For each "Tile"

    "Tile" is moving -> Set "Tile_Normal" at "Tile" position.

    So only when the tile is moving will update the position, instead of use every tick to get better perfomance with a lot of tiles with normalMaps.

    The problem is that actually i have to do an individual event for each one of movable tiles. So i though, ok, using families, one for "tiles" and other for "Tile normals" . I changed the previous code event and some variations but nothing, always there is something wrong on some site :S .

    Question: Is there any way to do it with families or another way i'm missing?

  • Lordshiva1948 Come on! .

    Already there is a lot people that in some time learned shaders or they actually work with that and can do in short time.

    For example, discover how apply the alpha in NormalMaps took me 2 days, and the solution was simply add "* front.a" at the end of the shader output ¿You think spend 2 days for that is give up easy?. An expert or somebody that already release effects and works with that can discovered/did it in seconds. If this took me two days imagine apply all this things of the tutorial, at the end i not will work nothing in the game.

    And for end, as i said: "i will give a try this weekend when i finish other things". BTW, for my game i not need this last things, with the actual NormalMaps effects i have just i need now, for that, apply all in this tutorial with spotlights,etc... maybe an expert with time can do that but with my skills on C2(I started a few days ago) and shaders, well , apologize me if i actually prefer invest the most part working in the game.

  • they are interesting but as you said seems complicated, maybe an expert can do all that, but i will give a try this weekend when i finish other things just for fun .

  • Instead every tick, with a simple "On start layout" set this parametres to the windows height/width sizes will be ok, but again you will need an event. The idea is put on the .fx to get it automatically without needs of nothing .

    I see "LightDir" inside the .fx but this is calculated automatically depending in where is the player respect the objects with normal maps. You set the LightDir to the point you want in the .capx in my case on the Mouse.X and Mouse.Y. I not understand in which way you want to use that variable ¿? .

    If you do will be good to see an example of the difference and the improvement

matriax's avatar

matriax

Member since 22 Jun, 2015

Twitter
matriax has 114 followers

Trophy Case

  • 9-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Viral Game One of your games has over 100,000 players
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies