Fresnel and Glossy shaders in GLSL2

noname00noname00 Posts: 8Member

How to get Fresnel and Glossy Shader effect in GLSL 2? can anyone of here code that shader for me, please?

Tagged:

Tags :

Answers

  • MegalomaniakMegalomaniak Posts: 951Admin
    Answer ✓

    What godot version are you using? If 3.0, any reason why the spatial material is out of the question?

  • noname00noname00 Posts: 8Member
    Answer ✓

    @Megalomaniak said:
    What godot version are you using? If 3.0, any reason why the spatial material is out of the question?

    I'm using Godot v2.1.4 (stable) Build. It is so because, the Godot v3.0 is not made for a average Android Mobile, as Many Times said by the Godot Developers. I'm using this version, so that I get get a android Game done, which just requires these 2 shaders, I can't write them myself, so, I asked in the community, if anyone knows. Hope you know how to Help me

  • MegalomaniakMegalomaniak Posts: 951Admin
    edited February 1

    2 options: shader-graph or shader-language.

    http://filmicworlds.com/blog/everything-has-fresnel/
    This will not be easy since I get the feeling you haven't written shaders, especially lighting components before...
    For the reflection in godot 2.x you either have to go for a cubemap or render-target, in both cases you will likely want to use the shader language over the shader graph since having just tested with v.2.0.2 cubemaps in shadergraph might be broken(but then perhaps that was fixed in later updates, my build is old). And for render-target you have to assign it through scripting anyways, so might as well stick to all code, I guess.

    Mind you if you manage to successfully implement Fresnel reflection in your shader then you've basically graduated to technical artist status. Most things from this point forward will be reasonably easy to figure out.

    Honestly though I'd skip this whole endeavor. An average android phone ain't going to perform well with such a heavy shader anyways. And if you are going to target higher end phones then godot 3.x is a better choice and makes your life in regards to all this much easier.

    Why not go for something like this instead:
    https://msdn.microsoft.com/en-us/library/windows/desktop/bb147401(v=vs.85).aspx

  • noname00noname00 Posts: 8Member

    @Megalomaniak said:
    2 options: shader-graph or shader-language.

    http://filmicworlds.com/blog/everything-has-fresnel/
    This will not be easy since I get the feeling you haven't written shaders, especially lighting components before...
    For the reflection in godot 2.x you either have to go for a cubemap or render-target, in both cases you will likely want to use the shader language over the shader graph since having just tested with v.2.0.2 cubemaps in shadergraph might be broken(but then perhaps that was fixed in later updates, my build is old). And for render-target you have to assign it through scripting anyways, so might as well stick to all code, I guess.

    Mind you if you manage to successfully implement Fresnel reflection in your shader then you've basically graduated to technical artist status. Most things from this point forward will be reasonably easy to figure out.

    Honestly though I'd skip this whole endeavor. An average android phone ain't going to perform well with such a heavy shader anyways. And if you are going to target higher end phones then godot 3.x is a better choice and makes your life in regards to all this much easier.

    Why not go for something like this instead:
    https://msdn.microsoft.com/en-us/library/windows/desktop/bb147401(v=vs.85).aspx

    Thanks for your response, Everything has Frensel.... Yes, everyone knows that especially if you've graduated in Science and know the basis of Light Reflection. The phenomenon Diffraction, of Modern Quantum Theory, states, that, Light is a Wave, but with a particle nature. It means, that Light is a wave i.e. the size of the wave determines it's color in the spectrum, but, it behaves like steam. If you'll keep a ball over a steam, you'll see that Angle of Incidence isn't equal to the angle of Reflection in some parts. In CG, that's called Fresnel Effect.

    I'm new to Shaders, so, is there a free e-book, which you know, might be quick and good for me? (for GLSL2)

  • MegalomaniakMegalomaniak Posts: 951Admin
    Answer ✓

    Nah, don't know of any specific e-books or cheat-sheets as such. I've mostly learned from experimentation and reading academic whitepapers, developer blogs, forums such as gamedev.net etc. As for spectral rendering - none of us are going to do monte carlo light transport in real-time soon.

    If you are interested in implementing a Fresnel effect look into Shlick's approximation(as mentioned in the article linked in my previous post).

  • MegalomaniakMegalomaniak Posts: 951Admin
    Answer ✓

    Here you were asking for resources and I just posted some that came to mind at another thread. Worth checking out.

Sign In or Register to comment.