Learn to Codea - Shaders 3 - Textures

Learn to Codea - Shaders 3 - Textures

Learn to Codea - Shaders 3 - Textures.zip (3.4 KB)

Codea Version

Modern

Description

Following on from the previous shader lesson, this example teaches you how to use uvs to sample a texture and display it on the screen!

Previous Lesson - UVs

API

sprite(shader)
background(shader)

Manual

https://johntm.github.io/Codea4-Docs/manual/shaders.html

Learn to Codea?
This is be part of an ongoing series called “Learn to Codea”, which will cover a variety of topics from beginner to advanced and everything in-between

2 Likes

Nice to see small examples, this one crashes though, I sent a crash report.

Ah ok, thanks for letting me know, might just need to put out an updated build

@John - fascinated by these new shader examples, V4 looks to be a massively expanded package.

Just one query on background() - in your new manual description you refer to loading a shader, coloured background or cubeimage. I assume V4 will recognise a cubeimage but there is no mention of a 2D background image. How does that work ?

It doesn’t support regular images but I can easily add that (although it’d be squashed most of the time unless we add some extra options for that)

I got the same crash.

We just put out a new beta, if you are on it these should work now

Yes, it works now! :slight_smile:

My example worked, But when I stop it, there’s a 50% chance it will crash

Thanks for catching that. It only seems to crash in release mode. I think I’ve fixed it now and uploading a new build to TestFlight now