Lets study shadergraph together...

MegalomaniakMegalomaniak Posts: 297Member
edited December 1969 in Shaders
...by sharing bite sized examples of things we have figured out.


For an example here's how you get a texture to tile via UV Coordinates:


simple enough.

Or how about getting a specific texture form an atlas and tile it:


first texture starting from top-left in the atlas.


and the one underneath it along V.

Post what you've found! G:

Comments

  • BishopBishop Posts: 168Member
    Yes, it is such a little treasure in the Godot, I only tried to animate the uv, for clouds or water, I must learn more the shadergraph Smiley
    Thanks for sharing!
    ...so I was wondering still, I'm sure you would do the night/day cycle with shadergraph,I must to somehow try Smiley
  • PlanetKillerPlanetKiller Posts: 24Member
    Sigh ...
    https://drive.google.com/open?id=0B3i2iHqe6FauR0J2a05Pc3JVQmc PDF
    https://drive.google.com/open?id=0B3i2iHqe6FauRGpqQ21YcnlELXM ZIP

    I always post some of my work for noobs, mainly because shaders are so awesome once you learn them.

    Also about the sky (day night) If you are in 3D; good luck. I have been trying that since 1.0 and I am about to give up. Mainly you would just have a skydome object follow your player, but animating it via shaders may be more trouble than it is worth.

    Twinkling stars, however, would be easier and nice looking. I might just try to swap cubemaps at different times of the day.

    Outputting a screenshot or several every second or so to a side of a cubemap, or maybe using 360 different images per side (there would be some overlap, every 5 minutes for 24 hours) ... maybe if I could take a non-active camera and modify (or set) the resolution of its output. Minecraft's flat cloud layer might just follow the player, or something like the Dark Cloud games, getting a skydome to follow the player is easy, but it might shudder depending on how fast it updates. Could I rotate an image before applying it to a cube map? Maybe just change sky color and let the player deal.

    Sorry, rambling; maybe you'll find something interesting in my madness.
    Also for tiling textures, you need to open the texture in Godot and set it for tiling (or you get funky stuff).
  • MegalomaniakMegalomaniak Posts: 297Member
    A question for the round table...

    Which of the input and output node's plug's/options do you find the least self-explanatory/most confusing? I'm thinking of tackling those next but unsure which might most confuse newbies.

    Also about the sky (day night) If you are in 3D; good luck. I have been trying that since 1.0 and I am about to give up. Mainly you would just have a skydome object follow your player, but animating it via shaders may be more trouble than it is worth.

    From my own tests so far just using an animation player to control the rotation of the night-sky sphere and color values of the Sunlight and Atmosphere/Skybox sofar works out fairly straight forward...
    This is for a fairly simple sky though that changes 4 times per in-game 'day'. Dawn, Noon, Evening & Night. Time determined by a fairly simple 'state-machine' and a custom time-counter.
  • MegalomaniakMegalomaniak Posts: 297Member
    edited August 2016
    Sorry for being gone for so long, have been busy dealing with a lot of personal life stuff.
    Some of it is still taking up my time but at least I found some time to mess a little more with shaders again.

    So here's a simple "pseudo-random" procedural noise I found on stack exchange(thanks go out to user Grumdrig there): http://stackoverflow.com/questions/12964279/whats-the-origin-of-this-glsl-rand-one-liner


  • MegalomaniakMegalomaniak Posts: 297Member
    edited August 2016
    And here's the graph for procedural checkers(and the noise tree is still visible at the bottom too):



    And to help understand how these are produced: They both derive from the UV input since it gives me 2 gradient's local to the object(space) to work with. 1 for X axis and one for the Y. For the checkers I just round the gradients to get black and white steps out of them. :)
  • MegalomaniakMegalomaniak Posts: 297Member
    edited September 2016
    Some Diamond-Squares:


    With the exposed parameters changed you can get something more wall- or floor-tile like:


  • TrinketosTrinketos Posts: 7Member

    Prosedual Textures, right?

  • MegalomaniakMegalomaniak Posts: 297Member
    edited February 28

    The last three examples? yes. I wish we had groups for shader-graph would make it easier to develop complex shaders and easily share them.

    And an instance iterator node/graph. that would be awesome.

  • TrinketosTrinketos Posts: 7Member

    a terrain shader would be great, maybe for 3.0 xD

  • MegalomaniakMegalomaniak Posts: 297Member

    Yeah, I'm definitely interested in doing that, but the builds of 3.0 I've tried so far don't really work for me yet under windows 7, will probably build a completely new workstation with Ryzen in a couple of months and will be using linux so might be able to test 3.0 then.

  • TrinketosTrinketos Posts: 7Member

    I have the same problem to whit godot 3.0

Sign In or Register to comment.