Jump to content

Recommended Posts

Posted

I was experimenting with rendering, and would like to explore more in the field of shaders.

My questions are:

  1. What exactly are shaders?
  2. How do shaders work?
  3. How to use shaders?

 

Alternatively, are there any resources I can read to get a better understanding of how to use shaders?

Some tips:

  Reveal hidden contents

 

Posted
  On 4/24/2019 at 1:43 PM, DavidM said:
  • What exactly are shaders?
Expand  

A shader is a program that executes on your GPU. It gets some data as an input and it outputs some data. That's all there is to them.

 

  On 4/24/2019 at 1:43 PM, DavidM said:
  •  How do shaders work?
Expand  

When opengl renders stuff it goes through various passes, during which it may interact with the currently active shader program. An interaction in this case would be opengl passing some data to the program and collecting the results.

 

  On 4/24/2019 at 1:43 PM, DavidM said:

How to use shaders?

Expand  

Write one, bind it before rendering and you are done.

 

Of course shaders are fairly complex and difficult to discribe like that. There are many resources online that introduce you to shaders. Just keep in mind that minecraft isn't exactly shader friendly, as in it's rendering engine is a huge mess of pre 3.0 and post 3.0 GL code.

 

  On 4/24/2019 at 1:43 PM, DavidM said:

Alternatively, are there any resources I can read to get a better understanding of how to use shaders?

Expand  

https://learnopengl.com/Getting-started/Shaders is a good one I am personally aware of, but apart from that just google "opengl shaders tutorial" and I am sure you can find a lot of information out there.

  • Thanks 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.