I would like to model oil and acrylic paint on a canvas in such a way that I can add a brush stroke to the canvas and have the colours mix.
I don't want to animate this happening, I just want to be able to model the final outcome of a brush stroke on existing paint.
Any suggestions?
The program ArtRage does this very well, I think by looking at that you can get a good idea of how to do this.
Each pixel on the canvas needs to store several attributes related to paint; you can imagine that each pixel will store the amount and color of the paint at that point at the minimum. Painting would be a matter of starting with a set amount of paint on the brush, then as the mouse traces a path to paint, remove some from the brush and add some to the affected pixels.
This is just an overview of the most simple way to do this, there are many more details that will make this look much better (such as shading with a light source to get the 'bump' appearance).
You need to study liquid dynamics. Far too complicated for me, but that might be a good starting point for you. Not sure many people will be able to help you. Good luck
Related
I need to create random-shaped (could be rectangular or circular) border for my UI, which can change its size, thickness and color of line. What approach to choose?
9-slice scaling texture is not an option since I need to change colors of line and background dynamically.
Write my own shader - I tried to dive into it and I think I'm not up to it right now. Also I was unable to find shader like this made by someone else.
Create border as a mesh, which is probably expensive in GPU resources.
This must be very common task, I really need advice from experienced unitist. How would you do this?
Thanks.
So I have a mesh curve that I've imported from Blender. What I want to do is to place individual points on the curve (at fixed distance) and then based on a specific number, color them.
Let's say for instance number 1000 is color red and number 10 is color blue (based on color gradient). These numbers get updated real time, so I want my color to get updated real time.
I have no idea how to approach this problem. I've looked up some ideas but couldn't find anything useful.
Thank you.
Bad news, it's by no means easy to do this.
Unity is a game engine - it's just not relevant to that type of problem you know?
I believe the only real solution would be to do it at the shader level.
As you know writing shaders is a whole engineering field in itself. I suggest, just google things like "Unity3d color gradient, shader" in the first instance.
For example,
http://answers.unity3d.com/questions/1108472/3-color-linear-gradient-shader.html
One thing you can conceivably do. Make the rope white. Apply lights to it! So, colored narrow beam lights or carefully placed diffuse lights. Perhaps in conjunction with layers for the lighting. It's not inconceivable it could work, enjoy!
Note - in fact the OP solved the problem just using colored lights - a solution in some cases.
Please note, the GL api is perfect here also.
user2299169 gives an outstanding link in the comments above:
http://gamedev.stackexchange.com/questions/96964/how-to-correctly-draw-a-line-in-unity
GL Doco: https://docs.unity3d.com/ScriptReference/GL.LINES.html
Thanks user2299169.
ask a general question. There are few sprite resources and they are hardly liked by me. I would like to learn from the absolute scratch, such as how do I create a sprite from my idea.
Can I ask do I create it this way or what's the standard process?
1. draw it on white paper
2. scan it into a .png jpg etc
3. render it in photoshop
Thanks.
It's not quite right for Stack Overflow indeed, but I have a few suggestions anyway.
If you want to hand draw your art there are a few approaches. I started drawing the resources I needed on paper and scanning them, but this raises a couple of problems.
The first problem is that it can be hard to remove the white background properly leaving nasty bitty edges. This can be solved with time, practice and patience, and as far as I know there is no good way around this.
When using paper, it can be very hard to get clean areas of solid color. Pencils and the like leave and extremely distinctive paper texture, but approaches that give more solid colors using inks tend to go very blotchy.
The other problem is that if you want to animate these, or indeed reuse part of one sprite in another, you're left drawing bits of sprites - this lead me on to my currently favored methodology.
My recommendation would be to use ink onto acetate. You'll need to do some research into the best inks to use, but it means you can build the sprites in layers, much like animators used to do for film back in the day. You still have to solve the white background problem after scanning though, and if you pick the wrong ink it can be very easy to smudge your drawings - not ideal.
The other, more expensive alternative is to use a graphics tablet, and cut out the paper/acetate stage all together. This solves the white background problem, but some people find drawing with tablets oddly difficult - myself included.
Adobe software wise - I would personally use Illustrator while working with a graphics tablet, Photoshop for making adjustments to the resulting images, and Fireworks for building UI interface elements.
Hope this helps!
This is not really a coding question. As far as I know stackoverflow is only for technical problems. That said, I would recommend Illustrator to get started. There are some great tutorials out there. :)
I'd like to allow a user to add a shape (which would just be a UIImage) onto some sort of canvas, then move and resize it on the screen but I'm not sure how to go about this. Ideally I'd like the basics of a drawing app which can use images from a user's device. Each shape would have an associated position, size and z-index.
The only thing I'm unsure of is how I'd create a bounding box (the one with four blue dots to allow resizing/moving). I have experience with UIKit, and would prefer to keep the majority of the app in this for the time being, but I get the feeling this type of thing might be better suited to Cocos2D or a similar framework.
If anyone has any pointers/open source code I can dig through it would be hugely appreciated.
I think you should look into CALayer, or even CAShapeLayer. I'm just starting to play with them, but I'm pretty sure you can easily get the functionality you want with either. Draw the border in the layer's drawLayer:inContext:. Check out the Quartz2d Guide path drawing section for the functions you need.
I want to color the country on selection of the country from a tableView. Can you help me please?
Considering your case, let me give you a heads up that this would require edge detection (so if you haven't done that before, it will take a LONG time), though not lots of it and the following is just one way of approaching this problem:
1) Take out an image context from the map you have.
2) Apply relevant edge detection algorithms in the area you want and use a bright color to differentiate. Note that this way, the inside would not be colored and I can't tell you for sure if that's possible or not.
3) Add that context as a subView on top of the map.
Also take a look at the Quartz 2D programming guide for more tips.
I would suggest something different, though. Keep pre-stored images for all the possibilities and just put a UIImageView with that as its image in front of the map - this will save you a lot of headache.