Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Color blending and color count (Unity3D)

A topic by Crocozor created Oct 02, 2016 Views: 939 Replies: 14
Viewing posts 1 to 3

Hi ! I'm currently working on a game for the jam, and I was wondering : Are the shades of color created by Unity's resolution downscale count as color ? What I mean is : objects get blurry countour because of the downscale, and I was wondering if the those blurry lines count as color.

Sample of color blending in Unity

And if it does ? Well I was wondering if anyone had some advice on how to make Unity render only a definite color palette using Unity3D Free.


Thanks in advance for the help, and good luck to those participating ! :D

Submitted

It would count, yes.

But if it's only their because you're unable to solve the issue, I don't think anybody is gonna berate you for it.

This might be handy if you want to try and fix it, though https://theadrainblog.wordpress.com/2016/09/05/pix...

I'd suggest using assets that are the correct scale to begin with, too. Scaling causes all sorts of issues at this low a res.

Wow ! Thanks a lot for the quick answer !

I'll look into that link and try to make it as clean as I can. Thanks again ^^

Submitted

Anytime! And good luck :D

Hello again ! I don't mean to ask too much, but I happen to have a question about the method you shared on the question page.

I have followed all steps and looked at the script used to rescale the camera, and I have been greeted with 3 errors :

Here is the console

I tried to specify arguments by changing :

RectTransform rt = gameObject.GetComponent ();

To

RectTransform rt = gameObject.GetComponent<RectTransfom> ();

Then Unity crashed. I don't really know what to do with this error. Did I miss something ? Is it a version issue ? (I'm working on 5.4.0b19 Personal, but know a friend who has the same issue on version 5.4.1f1 Personal)

Anyway, thanks for your help, we're really lost ^^'

Submitted

Arrghhh sorry.

It's the friggin' wordpress editor, it keeps removing < > tags every time I update it.

Do a ctrl+f for "GetComponent" every instance of it should be in the format

gameObject.GetComponent<TypeOfComponentYouNeed>();

so in your instance

RectTransform rt = gameObject.GetComponent<RectTransform>();

should be correct, if it's crashing that's really odd. Make sure it's attached to the correct object and that it actually has the correct UI components attached.

If you have any further issues let me know :)

Hmm, so we added "<GetComponent>", added "using UnitiyEngine.UI" (also tried without it), and well the script still crashes Unity. Gray areas for us right now would be :

-Must the script be attached to the RawImage or to something else ?

-We had to change m_VirtualScreen to "Sprite/Default" in order to toggle "Pixel snap". Could that be an issue ?

-Before adding the second camera, no change is visible. Do you have any idea what could cause this problem ?

Right now, we don't really know what more we could do, so if you have any ideas, let us know :D

Submitted

I've zipped up the project file for you to take a look at, and see if there's any differences between yours and mine.


http://sabercathost.com/G3j/VirtualCameraTutorial....


Yeah the scaling script needs to go on the RawImage object. But I'm not sure why it would be crashing rather than just not working/compiling.

We tried to match as many settings as we could, but couldn't make it work. Here is a version of the project including the script and some assets, maybe you can see something that's wrong. Until then, I will work without it, and try again if I have any more time.


Thanks for your help anyway if we can't find a solution. It still helped me understand a few things about Unity :D

Submitted

Getting a lot of errors trying to download and open that when google drive does it's thing.

Try zipping the entire project and just sharing that. I'll take a look and try to fix it.

Hmmm, that's weird. Try This link maybe ?

Just a quickie on my setup in Unity for a 3D game.

I have two cameras. The main camera is othographic and is looking at a texture with the correct aspect ratio with a black clear colour. This means all renders the game correctly by just looking at the quad in front of it and fills any extra space up with black.

The second camera points at the scene. It has a full screen effect that pixelates the screen to the correct resolution and limits the colours to four I like that are sort of like the gameboy. This is a 3d camera and renders to the texture the first camera looks at.

This setup allows me to render a 3d scene that looks like it was created with a gameboy. By carefully choosing materials and rendering an outline around stuff and on creases it should look alright but be quicker to set up and get working than writing a proper shader to do dithering.