isomer icon indicating copy to clipboard operation
isomer copied to clipboard

Add support for textures

Open jdan opened this issue 11 years ago • 18 comments

Instead of ordinary fill colors, it would be very useful to be able to place textures on faces.

jdan avatar Apr 27 '14 19:04 jdan

While it may not be the fastest, if you do a CanvasPattern and transform it via a skew matrix, you can probably simulate "projecting" a texture on a wall.

Though between #7, #8, and #9, I'm surprised you don't have per-pixel lighting as an option. Though if you get to that point, you may be better looking into WebGL then Canvas.

rcmaniac25 avatar Apr 27 '14 20:04 rcmaniac25

I don't think ordinary canvas operations are performant enough for per-pixel lighting, are they?

jdan avatar Apr 27 '14 20:04 jdan

Then we should ask the question of caring about mobile support?

FranDias avatar Apr 27 '14 20:04 FranDias

Hence why I said it probably isn't best unless you want to switch to WebGL

rcmaniac25 avatar Apr 27 '14 20:04 rcmaniac25

In the end it has to be simple. I'm not aiming to compete with Three.js or other graphics engines. This is really meant for simple artwork.

That being said, it's important to fix little bugs like #6, and add small features like textures. I guess performance doesn't need to be stellar.

jdan avatar Apr 27 '14 20:04 jdan

Perhaps change the color option when adding to "fill"

rcmaniac25 avatar Apr 27 '14 20:04 rcmaniac25

I would absolutely love texture support. Is this something you've started work on, or should I take a look at doing this?

owenversteeg avatar May 22 '14 01:05 owenversteeg

@owenversteeg nope I haven't worked on this at all :) Feel free to take a stab at it.

jdan avatar May 22 '14 02:05 jdan

@jdan what's the status of this issue? I mean, I see it's closed, but wondering why. Implemented?

whoeverest avatar Mar 26 '15 18:03 whoeverest

@whoeverest This one's still open, #55 was closed as a dupe.

Status is that we're looking for a suitable WebGL library upon which to build Isomer. The threejs branch contains a rewrite using - you guessed it - Three.js, but I was super unhappy with the size of the resulting bundle (close to a megabyte!)

@cryptoquick Pointed out that stack.gl might be a suitable candidate.

jdan avatar Mar 27 '15 17:03 jdan

Ah, sorry, it looks like I don't know how to GitHub. :-))

Does this mean that textures won't be supported in the basic no-three.js-or-whatever branch?

whoeverest avatar Mar 27 '15 18:03 whoeverest

@whoeverest Ideally we'll be using the new webgl stuff in master - I thought about splitting the library into two but I don't think it's a great idea.

jdan avatar Mar 27 '15 18:03 jdan

@jdan I see. Personally that doesn't make me too happy, since I plan on using Isomer to build a game that's expected to work on older hardware (http://sugarlabs.org/) but I understand why you want to go in that direction.

I guess I can always make a fork and add whatever features I need in the vanilla version.

whoeverest avatar Mar 27 '15 18:03 whoeverest

@whoeverest in an ideal world I'd spin this off into a github org and we'd have isomer-threejs as well - which falls back to canvas :) code-size is much larger, though.

jdan avatar Mar 27 '15 18:03 jdan

IMO, it doesn't fit terribly well for my use-case either. I actually prefer a 2D canvas solution, and it also opens itself up to a whole new area of open source graphics novel code; 3D has been done to death. Another advantage to keeping it on 2D canvas is that having the option to easily render on the backend is a huge bonus.

cryptoquick avatar Mar 27 '15 19:03 cryptoquick

@jdan One possible solution would be to have a backend object. Then you say "this object has a texture" and the backend figures out what to do with it. Then you can have your threejs backend and your Canvas backend.

rcmaniac25 avatar Mar 27 '15 20:03 rcmaniac25

Any news on this? I know this request is already a coupe lof years old, but it would still be amazing to apply textures!

clvrk avatar May 03 '19 19:05 clvrk

This library looked awesome to build a small interactive game but I would have loved to be able to use my own sprite

crimson-med avatar Oct 30 '20 03:10 crimson-med