• Journey's End on PC - Find info here and here. Please report bugs and issues for PC 1.4 and 1.4.1 to Re-Logic here.
  • Journey's End on Mobile - Find info here. Report bugs for Mobile 1.4 to DR Studios at this link and give as much detail as possible.
  • 1.4 will bring many changes to the PC version. We strongly advise making plans to back up your worlds and players prior to updating your game. More details here.
  • Console and Switch - The latest news can be found here. To report a bug, please use this link.

A Beginner's Guide to Shaders

Tyndareus

Terrarian
I'm not really good enough yet this, but it's possible to directly pass shaders without going through Terraria first
Take a look at Spirit's Repo on Github, it has a decent example of how to use a shader with custom params on primitive drawing

I would also suggest Starlight River too, but I don't think Scalie wants me sharing that one around, you can find links thou in TML's discord if you wanna dig, but I'm not posting a direct one on the forums
I managed to get it working, at least for NPCs seems the issue is to do with draw states and their resolution order, I'd need it to be on the player obviously but I guess ill just have to pass each texture to the shader.
I moved from using a terraria based shader and purely XNA so its just an Effect that I apply between draw calls.
Strangely enough the player doesn't even have a pre/post draw its just funnelled through main's draw so I'd need to utilize something like a projectile instead of custom drawing for what I am trying to do.
 
Strangely enough the player doesn't even have a pre/post draw its just funnelled through main's draw so I'd need to utilize something like a projectile instead of custom drawing for what I am trying to do.
Because the player is a ton of drawing calls in a list of something called player layers, if you want to alter the vanilla layers your going to have to likely use some IL editing (not really a good idea unless you know completely what your doing, vanilla layers use dye shaders) or otherwise mess with the layers (you could add your own layer if you need to draw something new over the player, you can add a new layer, draw whatever, and give that the custom shader and then reset the spritebatch)
 

CantWontDo

Retinazer
The post talked about how screen shaders can flip your screen upside down if you wanted to. Is it possible to flip the screen horizontally when a boss attacks?
 
Wow, finally made an account here specifically for this question...
Can you call a shader inside another shader?
I just wrote a piece of 'wrapper' math that acts like an image mask - essentially a more complicated version of the demonstration gradients.
Ideally, I'd like to be able to slap this function onto/around any of the other shader functions (passing it parameters as needed), but I've never used C# before so I don't know how to do that properly. (I'm assuming that on some level, shaders are Just A Kind Of Function, and there's no deep hardcoded witchy magic constraining what you can do with them???)

I think this would require adding an additional parameter that holds the name of the shader you're specifically passing in?
 
Top Bottom