Search Unity

GameDevBill tutorial comment thread

Discussion in 'Community Learning & Teaching' started by gamedevbill, Aug 4, 2020.

  1. gamedevbill

    gamedevbill

    Joined:
    May 25, 2018
    Posts:
    43
    I'm making this thread as a home for comments or questions about any tutorial on my site: gamedevbill.com

    I'm doing this here because the comments on the site itself are getting overly spammed, so I'll be shutting them off soon.

    If you are new to my site, welcome, and please give it a visit :)
     
  2. patrick-emmerich

    patrick-emmerich

    Joined:
    Mar 28, 2016
    Posts:
    6
    Hi Bill,

    Just want to start by saying that your blogpost on Full Screen Shaders in HDRP has been extremely helpful in learning custom post processing with HDRP. I'm new to shader development, so there's something that I've been struggling with that might be simple.

    How would you reverse the black and white effect from your post so that the yellow hard hat was the only thing in black and white, while the rest of the render was not affected?

    Thanks,
    Patrick
     
  3. patrick-emmerich

    patrick-emmerich

    Joined:
    Mar 28, 2016
    Posts:
    6
    I was able to do this by inverting the min/max smoothstep values. Thanks again for the tutorials.
     
    gamedevbill likes this.
  4. gamedevbill

    gamedevbill

    Joined:
    May 25, 2018
    Posts:
    43
    I'm glad you got it figured out :)

    The other thing you could do is a one- minus on the smoothstep output, like so:

    float mult = 1 - smoothstep(0.08, 0.10, dist);


    Thanks for reaching out, sorry i wasn't able to see this before you solved it for yourself
     
  5. Cayson882

    Cayson882

    Joined:
    Nov 1, 2020
    Posts:
    1
    I am working on a project based on the use of energy and how energy can renewable. There are many ways which are used to produce energy and wind is one of them and this energy is used for commercial use. Advanced technology like professional essay writer , 3D printing and analytics are creating a good impact on the energy industry.
     
  6. patrick-emmerich

    patrick-emmerich

    Joined:
    Mar 28, 2016
    Posts:
    6

    No problem at all, I appreciate your response. Your tutorials have been quite helpful.
    I'm currently struggling with another problem that you might be able to offer some insight on.

    When I apply this post process effect using the Oculus Rift-S it is rendered properly half on one eye and half on the other. But when I run the effect on other devices like the Oculus Quest in Link mode for example, I am seeing the full effect duplicated in both eyes.

    I've been reading this article which seems to be closely related to the issue I'm having

    https://docs.unity3d.com/Manual/SinglePassStereoRendering.html

    Unfortunately I think this article is using a different shader syntax than the new HDRP? I'm getting an undeclared identifier for the UnityStereoScreenSpaceUVAdjust method. I also have the rendering set to multi pass which doesn't fit with the issues explained in the article, but perhaps the Quest is defaulting to single pass.

    If you have any thoughts on this your feedback would be greatly appreciated.

    Thanks,
    Patrick
     
  7. gamedevbill

    gamedevbill

    Joined:
    May 25, 2018
    Posts:
    43
    Unfortunately I have not done any RiftS development, so I can't really say how to fix what you're seeing. I will say though, that I was under the impression that HDRP didn't fully support VR. If doing VR I thought you had to do URP. My info could be very out of date though, so don't take this as a guarantee.
     
  8. K-Skanz

    K-Skanz

    Joined:
    Jun 12, 2016
    Posts:
    7
    Hi, I'm from the Youtube
    I want to make a wave effect, so I followed your tutorial until this part:

    upload_2021-2-23_22-27-56.png

    Here I just changed the time from 0.1 to -0.1, then add a multiply to increase the wave:
    upload_2021-2-23_22-29-8.png
    And wanted the ring to slowly fade away, so I added a Lerp from the full effect to Zero. but I can't figure out how to make the T go from 0 to 1, I tried to Split the Subtract:

    upload_2021-2-23_22-31-16.png

    But, even the subtract going from White to Black, he doesn't give a color value that I can use as time. And tried all output of Time Node.

    I'm new in the Shader Graph, so probably I'm in the wrong way.
     
    gamedevbill likes this.
  9. gamedevbill

    gamedevbill

    Joined:
    May 25, 2018
    Posts:
    43
    Sorry it took me so long to reply! The weather in texas (and electricity) threw off my February a bit.

    For context of anyone else reading this, the tutorial in question is here:


    First, let me see if I understand what you are wanting to do:
    • You want the shockwave to go from some focal point outwards (as it does in the tutorial)
    • You want it to be stronger than the tutorial (hence your multiply)
    • You want it to be stronger in the middle, then weaker as it goes outwards? OR You want it to be stronger the first time it pulses, then get weaker as it repeats?
    If you just want it stronger in the middle and weaker on the outside:
    1. Feed the Distance value into a one-minus node
    2. Multiply your circle-wave by that value.
    You may also need to multiply it by something to adjust strength (maybe before or after the one-minus). Generally Distance is 0 at the focal point and gets bigger as it goes out, and you want the opposite.

    If you want it to get weaker over time, then you'd want to take the same thing you're feeding into Fraction (time or time multiplied) and feed that into a Floor node. This will give you the integer value of time. From there the math is up to your specific case. Here's an example that would make each shockwave a little weaker, but then reset to full after 10 shockwaves:
    1. Feed Time (or time multiplied) into Floor
    2. Then into a divide by 10 (so 6 becomes 0.6, and 16 becomes 1.6)
    3. Then into a Fraction (so 0.6 and 1.6 become 0.6)
    4. then into a one-minus (so 0.6 becomes 0.4)
    5. multiply this by the final wave strength.

    It could be I'm misunderstanding the question. If so, please give me some more details and I'll see what I can come up with.
     
    nx-sm and K-Skanz like this.
  10. K-Skanz

    K-Skanz

    Joined:
    Jun 12, 2016
    Posts:
    7
    I think I'm doing something wrong, the wave effect disappeared in the game view, but in the Shader Graph it's ok, I guess, this is my nodes:
    upload_2021-3-6_18-52-37.png

    And in the Shader graph looks like the wave is in some "Stairs Effect", like suddenly going from one value to another.

    What I want to do is a wave that slowly decreases when near the center:

    upload_2021-3-6_19-0-40.png

    In your tutorial, I inverted the time multiply from 0.1 to -0.1, so the wave starts from the edges and ends in the center, but the wave is too big and swallows the island.

    To fix this I tried to add a Lerp going to "Full Wave" to "Zero":

    upload_2021-3-6_19-7-29.png
    If I manually change the T from the Lerp value, it works perfectly, but I can't figure out how to do it automatically, and if I try to use script, I can't sync the T with the wave.
     
  11. gamedevbill

    gamedevbill

    Joined:
    May 25, 2018
    Posts:
    43
    OH, you're inverting the direction of the wave. I get that now. Sounds like that part of things is working (right?). If not, another way to do what you want is to take what is currently Time->Multiply->Fraction and make it Time->Multiply->Fraction->OneMinus. The One-Minus will take the input that was going 0 to 1, and make it 1 to 0.

    Two things to say here, as "big" can mean a couple different things in this context. As to how aggressive the wave itself is, that should be controllable by the Magnitude input. If the issue is actually that the radius of the wave isn't right, that can be controlled by multiplying the output of "Time->Multiply->Fraction->OneMinus" by something. So you end up with Time->Multiply->Fraction->OneMinus->Multiply". The first multiply affects your speed (how quickly does the fractional part go from 0 to 1). The second (new) multiply affects the actual range of "time". In my graph it's 0 to 1, but you may need it to be 0 to 0.5 or 0 to 50 (or something else).

    Hope that helps, and thanks for watching the videos!

    -gdb
     
    K-Skanz likes this.
  12. unity_sUrVKyp4yYx6bA

    unity_sUrVKyp4yYx6bA

    Joined:
    Nov 26, 2020
    Posts:
    1
    Hi Bill,

    I was reading your awesome blogpost on Full Screen Shaders in HDRP, and following along with the positional grayscale effect.

    I want to make an effect where the full-colored area moves with my mouse position on screen. How would I do that?

    Thanks a lot!

    -James
     
  13. Zaffer

    Zaffer

    Joined:
    Oct 21, 2010
    Posts:
    266
    Hi GameDevBill,
    Thanks for your blog on added a unity game to a WordPress site. I'm using Unity 5.6.4f1, WordPress 5.9 (from my C-Panel) with PHP 7.4. I got the Easy WebGL plugin installed in WordPress and my game successfully uploaded to wp-content/unity3d/games/Color Cube. The Easy WebGL interface gave me the shortcode [unity3d_game game="Color Cube"]. I embedded this shortcode in my test WordPress page and the Easy WebGL splash screen came up but with the error message, "Game JSON not found : Color Cube." Any help with this will be greatly appreciated. Thanks.
    Zaffer
     
    Last edited: Feb 4, 2022
  14. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    383
    I posted on YT but will ask again here.
    I have the 2d working but the 3d is not.
    Posting the shader and the complete graph would stop all the useless posting and wandering diatribe.
    I am only interested in what works and debugging endless hours of tedious 'I dont know what I did wrong' is wasteful.
    No one can modify a shader for what they want if they dont have a working shader.
     
  15. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    383
    ...And I can not even upload a graph to show what I have. WTF?...(where's the file)
    No discord either?
    And I do believe that the gamdevbill shader graph versions are older.