Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
whorfin
Dec 6, 2007

crm posted:

Are there any tutorials for Unity 4 yet?

Like the other replies, not specifically 4.0, but UnityCookie has some fantastic tutorials. Free to watch the videos and read whatever text accompanies, $10 a month if you want to download the videos and get access to their assets (also gives you access to the other sites they run, like BlenderCookie if you're a Blender user).

http://cgcookie.com/unity/

3DBuzz also has some good Unity tutorials, including a pretty long Tomb Raider style platformer setup, but their website is total garbage for finding anything in a timely fashion.

Adbot
ADBOT LOVES YOU

Jewel
May 2, 2009

Gordon Cole posted:

I've been doing a little research on C++ engines and frameworks because I'm planning on using C++ for my next game project. I haven't tried it yet beyond building the demo, but Angel2D looks really nice, and it has built-in LUA hooks so you can tweak variables, run scripts or whatever at run time.

Polycode looks promising as well, although they're getting ready for a huge re-release and there's no information on their site at the moment. It may be worth checking out in the next couple weeks though.

Jewel posted:

I might quickly ask Garry what he uses via tumblr. I'll get back to the thread when/if he answers.

I got onto Garry about what library he uses to bind/hook lua onto C++ for GMod, and uh, weird response.

Garry posted:

I don’t use a library.. I don’t think you really need one. I just made a few macros and a class factory.

That seems like it would be hilariously obtuse to work with, but since I've never played with lua myself yet I can't be sure :psyduck:

Edit: Keep in mind lua plays a HUGE part in gmod, in the sense that every gamemode, weapon, entity, npc, and tool, are all coded in lua and bound onto the source engine.

KaneTW
Dec 2, 2011

One of the coders for a mod I worked on used luabind and I believe it worked pretty well.

E: but luabind seems deprecated by now.

Jewel
May 2, 2009

KaneTW posted:

One of the coders for a mod I worked on used luabind and I believe it worked pretty well.

That seems like what I'd want, yeah. No idea why Garry's hand rolling his own but I mean, it works..??

The Gripper
Sep 14, 2004
i am winner

Jewel posted:

That seems like it would be hilariously obtuse to work with, but since I've never played with lua myself yet I can't be sure :psyduck:
It really depends on how you want to do things, it's not really a mess to skip luabind unless you find yourself doing a lot of the things it provides that basic embedding doesn't (like calling object methods). Even then you can work around that with something like this if you really wanted.

luabind is pretty good though, I think a fair few games make use of it.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Jewel posted:

That seems like what I'd want, yeah. No idea why Garry's hand rolling his own but I mean, it works..??
From what I remember of him when he posted here more, he's just the kind of programmer who tends to do it himself. Probably because he digs the process of writing up low level stuff - using libraries kind of cheapens the fun, if you're into that.

I dig luabind, myself.

Shalinor fucked around with this message at 17:12 on Dec 17, 2012

Sylink
Apr 17, 2004

Suspicious Dish posted:

Sounds painful.



Is this a joke that I'm not getting or do you not like pyglet and why?

KaneTW
Dec 2, 2011

'derping around'

Jewel
May 2, 2009

So before I went to bed I finally actually read a bit more about lua rather than asking the thread about it, and somehow didn't know lua already came with lua.h and lualib.h, so I feel like a real dummy!!

After reading up a little (Will do more tonight) on using it from the book Programming in Lua, I'm totally understand how Garry would have done it now, yeah, but also I'm a little confused as to why someone would use luabind? From what I looked at the documentations of that, as of now it doesn't seem any less complicated than using the headers that come with lua :confused:

Kaelan Zero
Nov 30, 2004

smut

KaneTW posted:

One of the coders for a mod I worked on used luabind and I believe it worked pretty well.

E: but luabind seems deprecated by now.
Don't use luabind for anything you plan to keep. It's kind of a nice place to start if you just want to mess around - and if you've used boost.python it'll feel familiar - but it's incredibly buggy and has lots of rough edges. It also has some really subtle performance issues that make it a no-go if you're planning to use it in games. For example, when I used it I discovered that it called strcmp() for every table access on every object you exposed to Lua, every time, even though a basic understanding of Lua architecture would make it obvious that you don't need to do that. :(

There are also some nasty interactions between luabind and the rest of boost - specifically shared_ptr and weak_ptr and the way object construction works - that make it tough to integrate with a larger game engine.

Luabind's appeal - i.e. why would you use it - is roughly the same as boost.python's. When it works, it automatically figures out things like argument types and can marshal things onto/off of the Lua stack for you. Great in theory, especially if you want to have a codebase that mixes C++/Lua without hand-writing and maintaining tons of Lua glue.

On the other hand if you are already a Lua expert, I bet you could probably use luabind to save yourself a bunch of time when building something huge, just because they did a bunch of the work for you already. It'd probably be trivial for an expert to go in there and sand down the rough edges.

Jewel
May 2, 2009

Kaelan Zero posted:

Don't use luabind for anything you plan to keep. It's kind of a nice place to start if you just want to mess around - and if you've used boost.python it'll feel familiar - but it's incredibly buggy and has lots of rough edges. It also has some really subtle performance issues that make it a no-go if you're planning to use it in games. For example, when I used it I discovered that it called strcmp() for every table access on every object you exposed to Lua, every time, even though a basic understanding of Lua architecture would make it obvious that you don't need to do that. :(

There are also some nasty interactions between luabind and the rest of boost - specifically shared_ptr and weak_ptr and the way object construction works - that make it tough to integrate with a larger game engine.

Luabind's appeal - i.e. why would you use it - is roughly the same as boost.python's. When it works, it automatically figures out things like argument types and can marshal things onto/off of the Lua stack for you. Great in theory, especially if you want to have a codebase that mixes C++/Lua without hand-writing and maintaining tons of Lua glue.

On the other hand if you are already a Lua expert, I bet you could probably use luabind to save yourself a bunch of time when building something huge, just because they did a bunch of the work for you already. It'd probably be trivial for an expert to go in there and sand down the rough edges.

So I'm guessing I might as well just hand-roll it like Garry did. It doesn't seem like luabind's worth it imo.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
I really like javascript/html5 for making simple browser based stuff. I've been working on an artillery game. I think it's mostly finished, but any comments/suggestions are welcome. I've only tested it in Firefox and Chrome however.

xgalaxy
Jan 27, 2004
i write code

Jewel posted:

So I'm guessing I might as well just hand-roll it like Garry did. It doesn't seem like luabind's worth it imo.

If all you need is to bind C functions and expose them to lua, then this is really simple to do.
The harder part comes in when you are trying to fake lua classes and bind them to C++ classes.

Jewel
May 2, 2009

xgalaxy posted:

If all you need is to bind C functions and expose them to lua, then this is really simple to do.
The harder part comes in when you are trying to fake lua classes and bind them to C++ classes.

Ah, this is probably where I'll go wrong then. I was about to settle in and read a bit more of the book but yeah most of the examples I've seen were functions not classes. Hmmmh. Still don't feel luabind's the way to go, and the other libraries someone said they used are a full api, not just for lua, so I don't really wanna use that either..

xgalaxy
Jan 27, 2004
i write code

Jewel posted:

Ah, this is probably where I'll go wrong then. I was about to settle in and read a bit more of the book but yeah most of the examples I've seen were functions not classes. Hmmmh. Still don't feel luabind's the way to go, and the other libraries someone said they used are a full api, not just for lua, so I don't really wanna use that either..

It can be done, it's just more involved, more error prone, and honestly kind of hacky, to bind to C++ classes with Lua. You're better of just exposing straight C functions. You don't necessarily need to bind C++ classes, it it depends on what your requirements are.

An alternative is http://www.squirrel-lang.org/ which is basically Lua with real OOP support but I have no idea how simple it is to bind to.

Falcorum
Oct 21, 2010
Squirrel uses nearly the same binding model as Lua. If you're looking for an "automated" Lua binding generator similar to Luabind, LuaBridge (https://github.com/vinniefalco/LuaBridge) seems promising at least.

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.
This is probably the most common question here, but how can I make games that don't look like they were made by a 13 year old with a copy of RPG Maker if I don't know how to draw worth poo poo?

Polio Vax Scene
Apr 5, 2009



Rip off graphics, practice practice practice, find someone to make graphics for you, or make an "artsy" game and if people complain about the graphics just imply that they don't "get it".

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

Manslaughter posted:

Rip off graphics, practice practice practice, find someone to make graphics for you, or make an "artsy" game and if people complain about the graphics just imply that they don't "get it".
One way to go about "arsty" that is relatively easy for a non-artist is to work with silhouettes. If you also go with vector graphics it can partially make animation a programming task rather than an art task. And if you go with vector graphics and don't have any living characters, as with many puzzle/physics games, then it's even less arty.

That said, it's arguably still important to include the 'juice' factor, as I believe the tower of goo guy calls it. eg. make your buttons pulse and make a sound when clicked, make your submenus slide in / fly out of things / do something other than just appear instantly like a Windows window, make your score display roll up rather than just updating, make things that *do* appear and dissapear, appear and disappear in a splash of sparks, that sort of thing. That's a big part of what makes a thing look polished, and yes, it's time-consuming and kind of boring to do.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

roomforthetuna posted:

That said, it's arguably still important to include the 'juice' factor, as I believe the tower of goo guy calls it. eg. make your buttons pulse and make a sound when clicked, make your submenus slide in / fly out of things / do something other than just appear instantly like a Windows window, make your score display roll up rather than just updating, make things that *do* appear and dissapear, appear and disappear in a splash of sparks, that sort of thing. That's a big part of what makes a thing look polished, and yes, it's time-consuming and kind of boring to do.
It's critical, especially if you don't have artsy art, but thankfully it's mostly a programming task.

https://www.youtube.com/watch?v=Fy0aCDmgnxg

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
On the topic of Juiciness, I recently saw a "science game" (because FoldIt) where you did some tetris puzzle thing and you get one point for completing a level. Just multiplying that so you get 10 points or 100 points makes that a lot better. Even Mario was programmed this way, the score counter storing only up to the tens to save memory, and a static 0 being drawn in its place.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Sinestro posted:

This is probably the most common question here, but how can I make games that don't look like they were made by a 13 year old with a copy of RPG Maker if I don't know how to draw worth poo poo?

Learn to draw out of necessity, or hire an artist.

Unormal
Nov 16, 2004

Mod sass? This evening?! But the cakes aren't ready! THE CAKES!
Fun Shoe

roomforthetuna posted:

That said, it's arguably still important to include the 'juice' factor, as I believe the tower of goo guy calls it. eg. make your buttons pulse and make a sound when clicked, make your submenus slide in / fly out of things / do something other than just appear instantly like a Windows window, make your score display roll up rather than just updating, make things that *do* appear and dissapear, appear and disappear in a splash of sparks, that sort of thing. That's a big part of what makes a thing look polished, and yes, it's time-consuming and kind of boring to do.

I've found iTween (http://itween.pixelplacement.com/index.php) to be a pretty nice tool for automating some of this stuff if you're using Unity3D. (I think Shalinor originally suggested it in a thread somewhere.) It's just a small set of source, too, so it's pretty easy to hack in support for new stuff (like various 2D libraries, etc).

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!

Unormal posted:

I've found iTween (http://itween.pixelplacement.com/index.php) to be a pretty nice tool for automating some of this stuff if you're using Unity3D. (I think Shalinor originally suggested it in a thread somewhere.) It's just a small set of source, too, so it's pretty easy to hack in support for new stuff (like various 2D libraries, etc).

iTween is the best. Seriously, tween everything.

Truspeaker
Jan 28, 2009

Shalinor posted:

It's critical, especially if you don't have artsy art, but thankfully it's mostly a programming task.

https://www.youtube.com/watch?v=Fy0aCDmgnxg

That video has become my biggest inspiration in the last six months or so. Ive been using a LOT of NGUI, which has several basic tweening things built in that are pretty much fire and forget, around which Ive built a whole thing just to let you setup that stuff from the editor, and the difference is so wonderful. Its almost professional looking!

Of course, even with my newfound juiciness focus, sound effects are still the absolute last thing anyone ever thinks of :downs:

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!
Looking for a robust way to set up collision categories to handle most cases of colliding entities.

I was thinking that one way to go about it would be to set up three sets of properties for entities:

Collision Categories: Describes the nature of the object itself
Collision Targets: Describes things that the object collides into
Collision Excludes: Describes exceptions for targets. See example for clarification.

For example, let's say I have a level with walls and braziers that shoot out fireballs.

Wall
Collision Categories: Wall
Collision Targets: -
Collision Excludes: -

Brazier
Collision Categories: Wall, Brazier
Collision Targets: -
Collision Excludes: -

Fireball
Collision Categories: None
Collision Targets: Wall
Collision Excludes: Brazier

Player
Collision Categories: Player
Collision Targets: Wall
Collision Excludes: -

So, what this says in English: Players collide into anything marked 'wall', period. Fireballs collide into anything marked 'wall', except if that thing is marked 'brazier' as well.

This seems like it would cover most cases, anyone have any suggestions based on what they've seen or implemented in the past?

xzzy
Mar 5, 2009

I usually see stuff like that implemented as layers. Well really it's just tagging objects that you want to collide with the same id number, but it's usually described conceptually as layers. Objects in the same layer collide, and objects can be in multiple layers. Easy to implement because it only requires assigning an integer (or an array of integers) to your objects.

The example you give only requires two: walls and braziers. Fireballs are only on the wall layer, the player is on the walls and brazier layer.

xgalaxy
Jan 27, 2004
i write code

Orzo posted:

Looking for a robust way to set up collision categories to handle most cases of colliding entities.

I was thinking that one way to go about it would be to set up three sets of properties for entities:

Collision Categories: Describes the nature of the object itself
Collision Targets: Describes things that the object collides into
Collision Excludes: Describes exceptions for targets. See example for clarification.

For example, let's say I have a level with walls and braziers that shoot out fireballs.

Wall
Collision Categories: Wall
Collision Targets: -
Collision Excludes: -

Brazier
Collision Categories: Wall, Brazier
Collision Targets: -
Collision Excludes: -

Fireball
Collision Categories: None
Collision Targets: Wall
Collision Excludes: Brazier

Player
Collision Categories: Player
Collision Targets: Wall
Collision Excludes: -

So, what this says in English: Players collide into anything marked 'wall', period. Fireballs collide into anything marked 'wall', except if that thing is marked 'brazier' as well.

This seems like it would cover most cases, anyone have any suggestions based on what they've seen or implemented in the past?

That looks pretty good actually.

Other things I've seen are collision layers, which you can dynamically change at runtime. Everything defaults into the "all" layer, but otherwise only things on the same layer collide. This was in addition to a collision groups / excludes system similar to the one you have here.

And then supporting mechanisms like being able to turn on / off collision send / response on individual entities, whole groups, or whole layers.

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!

xzzy posted:

I usually see stuff like that implemented as layers. Well really it's just tagging objects that you want to collide with the same id number, but it's usually described conceptually as layers. Objects in the same layer collide, and objects can be in multiple layers. Easy to implement because it only requires assigning an integer (or an array of integers) to your objects.

The example you give only requires two: walls and braziers. Fireballs are only on the wall layer, the player is on the walls and brazier layer.
Yes, that seems like an easy solution. However, it seems to require pre-defining a bitmask of layers ahead of time, which is something I don't really want, since it's not quite as extendable. A search of collision categories/groups yielded some article about box2d which I think does the same thing.

Wozbo
Jul 5, 2010
It would seem more prudent to dynamically assign/ unassign collision layers and do collision on layer intersects. The best answer seems like it would be best solvable via SQL like SQLite, but I'm not a game dev.

xzzy
Mar 5, 2009

I guess it depends on what you intend to do with your game. If you think you're going to need complex collision filters it makes more sense to use properties. But if all you need is for fireballs to not collide with braziers, a couple integers might be good enough.

In my experience, "extensible" is a word that gets developers stuck in a sand trap. It's super tempting to make an awesome subsystem that can handle all possible permutations, but it generates the risk of you spending all your time making code rather than games.

If you think you need properties don't let me stop you. I'm just babbling. :v:

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Orzo posted:

Yes, that seems like an easy solution. However, it seems to require pre-defining a bitmask of layers ahead of time, which is something I don't really want, since it's not quite as extendable. A search of collision categories/groups yielded some article about box2d which I think does the same thing.
No it wouldn't.

Create a hash table that maps string names to integer layer IDs. Run all objects through that at init, to give them their fast collision ID. Creat another table of arrays, indexed by collision ID, where each entry in the indexed array is one integer layer that the collision ID collides with. You can add new entries and collision relationships runtime however you please, or even silently change the collision relationships of existing layers.

Simple, extendible, logical, etc. You can even drop the hash if you want, but I find working with named layers to be waaaaay easier. You could also do that hash map purely within your toolset, though, if you're working through an editor of some kind.

Shalinor fucked around with this message at 17:18 on Dec 19, 2012

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!

xzzy posted:

In my experience, "extensible" is a word that gets developers stuck in a sand trap. It's super tempting to make an awesome subsystem that can handle all possible permutations, but it generates the risk of you spending all your time making code rather than games.
I know what you're getting at, but it's not that complex. It took about 15 minutes to implement what I wrote above.

Shalinor posted:

No it wouldn't.

Create a hash table that maps string names to integer layer IDs. Run all objects through that at init, to give them their fast collision ID. Creat another table of arrays, indexed by collision ID, where each entry in the indexed array is one integer layer that the collision ID collides with. You can add new entries and collision relationships runtime however you please, or even silently change the collision relationships of existing layers.

Simple, extendible, logical, etc. You can even drop the hash if you want, but I find working with named layers to be waaaaay easier. You could also do that hash map purely within your toolset, though, if you're working through an editor of some kind.
I'll probably do something like this to speed up comparisons at runtime, but keep the named collisions how they are in the editor, thanks.

Paniolo
Oct 9, 2007

Heads will roll.
Go with a bitmask in-engine, and if you really need extensibility (I can almost guarantee you don't) then in the editor you can have some complex interface for defining custom layers and at import time assign them each a bit and generate an error if there's more than 32.

Anything that doesn't result in a simple "x & y" in the engine is way overkill.

Jewel
May 2, 2009

Shalinor posted:

No it wouldn't.

Create a hash table that maps string names to integer layer IDs. Run all objects through that at init, to give them their fast collision ID. Creat another table of arrays, indexed by collision ID, where each entry in the indexed array is one integer layer that the collision ID collides with. You can add new entries and collision relationships runtime however you please, or even silently change the collision relationships of existing layers.

Simple, extendible, logical, etc. You can even drop the hash if you want, but I find working with named layers to be waaaaay easier. You could also do that hash map purely within your toolset, though, if you're working through an editor of some kind.

Why wouldn't you just go (rough since tired and 4am)

C++ code:
#include <iostream>

using namespace std;

enum State {
    WALLS = 1<<0,
    PROJECTILES = 1<<1,
    OTHER_STUFF = 1<<2
};

int main()
{
    unsigned int assignedLayers = 0; //pretend this is in an object
    
    assignedLayers = WALLS | OTHER_STUFF;
    
    cout << "The object" << ((assignedLayers & WALLS)?" is ":" is not ") << "in the WALLS layer" << endl;
    cout << "The object" << ((assignedLayers & PROJECTILES)?" is ":" is not ") << "in the PROJECTILES layer" << endl;
    cout << "The object" << ((assignedLayers & OTHER_STUFF)?" is ":" is not ") << "in the OTHER_STUFF layer" << endl;
    
}
OUTPUT:
code:
The object is in the WALLS layer
The object is not in the PROJECTILES layer
The object is in the OTHER_STUFF layer

Jewel fucked around with this message at 18:09 on Dec 19, 2012

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Jewel posted:

Why wouldn't you just go (rough since tired and 4am)

(bitmasks)
Because I've been screwed before by running out of distinct values in a bitmask, and implementing them as the first-run collision system amounts (to me) to pre-optimization.

We're living in the land of quad cores as standard, where even AAA games seldom push the hardware due to consoles and slacking visual requirements. A couple extra "if's" won't hurt anyone, and if it makes the resultant code more flexible and easier to read/use, I'm all for it.

Now that said, I'd also bracket it all safely off in a corner of the engine, to make it relatively easy to switch to bitmasks if I ever had to for some reason... but if's are fine. Even on mobile hardware, it's fine.


EDIT: Completely unrelated... I keep hitting "man this would be cool with co-op" points in my code, but I keep avoiding them due to unknown cost. Has anyone tried doing a co-op game in Unity 3D? I'm curious how the networking layer is, or if it even exists in any practical sense, or what.

Might actually do a simple co-op game for OneGameAMonth. Seems like a perfect isolated-target sort of thing to experiment with.

Shalinor fucked around with this message at 18:55 on Dec 19, 2012

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

Jewel posted:

Why wouldn't you just go (rough since tired and 4am)
Also because a hash of strings that gets pre-mapped to indices means your editor and debugging stuff can both know the names of layers without having to have the names twice, once in #define and once in string form, which is always a bit aggravating when you add a new thing. And also your level file format or scripts or whatever can more easily use tag-names that way.

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!
Unity peeps, I'm working with an artist on an awesome space project. He has delivered a video of a sensors screen and was wondering if I could do it in code:



I see some pieces here -- render a rotating model, render some colored noise on top of that, use a shader to sample a displacement map to get the mosaic effect. Is there any way to do this with Unity free? It seems like accessing/altering the render targets is something I can't do without Pro.

NGUI looks like it might be able to do what I want, but I'm not about to pay for it just to find out. Any suggestions?

(The gameplay is that as you move closer/farther away, the mosaic gets higher/lower resolution, so a person with experience operating sensors can see a ship in the noise more easily.)

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Pfhreak posted:

I see some pieces here -- render a rotating model, render some colored noise on top of that, use a shader to sample a displacement map to get the mosaic effect. Is there any way to do this with Unity free? It seems like accessing/altering the render targets is something I can't do without Pro.
Short of jumping through some very, very serious hoops, you're going to flat out need Unity Pro for that.


You could approximate it with a rotating model in UI-space with an alpha card rendering in front of that which uses a UV flip-book animation. Each frame of the UV flip-book would be a different pattern of pixel'y chunky static, and you'd randomly choose one and display it, possibly using a grayscale texture so that you could then apply a tint, possibly not. It won't make the ship look aliased quite the way you've got there, and it won't allow for the toneshift / LUT-like appearance, but it may be close.

Try using additive or multiplicative (if Unity Basic supports it?) blending on the card, too. That + big chunky square pixels on the UV flip book MIGHT give the impression of a pixellated spaceship (whereas alpha blending probably won't, it'll look more like a static overlay). It'll require whatever color you're adding to be substantial, though, as a subtle color add won't cut it. Worth a try, at least. Also use point sampling, don't bilinear filter it, and the UV flip book pages should be pretty low-res.

Note that to do this right, you MUST keep the chunky pixels on your UV flip book properly aligned in screen space. If you don't do the proper half-dimension offset on the UVs each time to flip to a random page of the book, the "pixels" will shift, possibly breaking the illusion.

EDIT: for generating the flip book pages, look into layered Perlin Noise with high/low pass filtering. This writeup should get you started. You should be able to do it in Photoshop, no sweat. Bake it down to one PS layer per frame, and then use one of the many layers -> tiled animation frames export scripts out there to get your final flip book texture.


EDIT2: VV I think that custom shaders are another Pro-only thing, yes... but I could be wrong. If you can do a custom shader and don't care that the ship is real-time rendered, yep, that'd be the easiest/fastest/bestest way. I'd figured the ship had to change depending on target or something.

Shalinor fucked around with this message at 19:54 on Dec 19, 2012

Adbot
ADBOT LOVES YOU

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!

Shalinor posted:

Short of jumping through some very, very serious hoops, you're going to flat out need Unity Pro for that.


You could approximate it with a rotating model in UI-space with an alpha card rendering in front of that which uses a UV flip-book animation. Each frame of the UV flip-book would be a different pattern of pixel'y chunky static, and you'd randomly choose one and display it, possibly using a grayscale texture so that you could then apply a tint, possibly not. It won't make the ship look aliased quite the way you've got there, and it won't allow for the toneshift / LUT-like appearance, but it may be close.

Try using additive or multiplicative (if Unity Basic supports it?) blending on the card, too. That + big chunky square pixels on the UV flip book MIGHT give the impression of a pixellated spaceship (whereas alpha blending probably won't, it'll look more like a static overlay). It'll require whatever color you're adding to be substantial, though, as a subtle color add won't cut it. Worth a try, at least. Also use point sampling, don't bilinear filter it, and the UV flip book pages should be pretty low-res.

Note that to do this right, you MUST keep the chunky pixels on your UV flip book properly aligned in screen space. If you don't do the proper half-dimension offset on the UVs each time to flip to a random page of the book, the "pixels" will shift, possibly breaking the illusion.

EDIT: for generating the flip book pages, look into layered Perlin Noise with high/low pass filtering. This writeup should get you started. You should be able to do it in Photoshop, no sweat. Bake it down to one PS layer per frame, and then use one of the many layers -> tiled animation frames export scripts out there to get your final flip book texture.

Rather than rendering the ship to a texture, could I just draw a sprite of the ship to a quad and use a fragment shader on that quad? I figured render to texture was pro only, but are writing shaders?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply