microsoft / DirectXTK

The DirectX Tool Kit (aka DirectXTK) is a collection of helper classes for writing DirectX 11.x code in C++

Home Page:https://walbourn.github.io/directxtk/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shader on SpriteBatch?

aaronstackpole opened this issue · comments

I swear I saw a tutorial somewhere about applying shaders to spritebatch objects, like making edge glow? Is this possible, or am I out of my mind? Ok, the answer to that is obvious, but, you know... ;)

You are truly a saint, sir!

Can I ask for a slight clarification, then? This is how to make a custom effect on a 3D object. You had said in another thread that the SpriteBatch is just a particular projection, but I'm wondering if there's a way to apply shader effects to objects in the sprite batch? If I just need to read the above article in depth and it will answer my question, that's all I need to know. Basically doing a simple GUI system and I'd like to be able to make a button glow when I hover over it without having to make "glowing graphics" sprites. Seems it MAY be simpler just to figure out how to apply a "glow the edges of this" shader on the sprite.

I have a todo to add a specific tutorial on authoring a custom IEffect implementation which is what you need for 3D objects. SpriteBatch uses it's own shaders, which is what that tutorial covers.