Lets study shadergraph together...

MegalomaniakMegalomaniak Posts: 685Admin
edited December 1969 in Shaders
...by sharing bite sized examples of things we have figured out.<br /><br /><br />For an example here's how you get a texture to tile via UV Coordinates:<br /><br />
tilingtexture.png<br />[size=8pt]simple enough.[/size]
<br /><br />Or how about getting a specific texture form an atlas and tile it:<br /><br />
tilingatlas.png<br />[size=8pt]first texture starting from top-left in the atlas.[/size]
<br /><br />
tilingatlas2.png<br />[size=8pt]and the one underneath it along V.[/size]
<br /><br />Post what you've found! G:


  • SchusterSchuster Posts: 258Member
    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 :)<br />Thanks for sharing!<br />...so I was wondering still, I'm sure you would do the night/day cycle with shadergraph,I must to somehow try :)
  • PlanetKillerPlanetKiller Posts: 25Member
    Sigh ...<br />https://drive.google.com/open?id=0B3i2iHqe6FauR0J2a05Pc3JVQmc PDF<br />https://drive.google.com/open?id=0B3i2iHqe6FauRGpqQ21YcnlELXM ZIP<br /><br />I always post some of my work for noobs, mainly because shaders are so awesome once you learn them.<br /><br />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.<br /><br />Twinkling stars, however, would be easier and nice looking. I might just try to swap cubemaps at different times of the day.<br /><br />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.<br /><br />Sorry, rambling; maybe you'll find something interesting in my madness.<br />Also for tiling textures, you need to open the texture in Godot and set it for tiling (or you get funky stuff).
  • MegalomaniakMegalomaniak Posts: 685Admin
    A question for the round table...<br /><br />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.<br /><br />
    on 1459872456:
    <br />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.<br />
    <br /><br />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...<br />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: 685Admin
    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: 685Admin
    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: 685Admin
    edited September 2016
    Some Diamond-Squares:

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

  • TrinketosTrinketos Posts: 14Member

    Prosedual Textures, right?

  • MegalomaniakMegalomaniak Posts: 685Admin
    edited February 2017

    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: 14Member

    a terrain shader would be great, maybe for 3.0 xD

  • MegalomaniakMegalomaniak Posts: 685Admin

    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: 14Member

    I have the same problem to whit godot 3.0

Sign In or Register to comment.