1
\$\begingroup\$

I'm making a 2d game engine using Java Script and WebGL, both of which I am new to, and was wondering if it was a good idea to use a shader object to initialize the fragment and vertex shader and then attach that to a game object. I would then update the shaders by passing things like the screen coordinates, sprite sheet coords, and other information into those shader objects.

I'm not sure if this is the correct approach to rendering or if there are better methods of doing so.

\$\endgroup\$
1
  • \$\begingroup\$ What's a special problem you've encountered with this approach, or a specific alternative you want to contrast it against? If this method is working for you, there might well be nothing wrong with it, unless you've discovered some evidence that suggests otherwise? \$\endgroup\$ Commented Feb 26, 2023 at 10:43

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.