Filament add ambient light without IBL - webgl

I am trying to render a model with a ambient light added to the scene, however I didn't find any documentation about it..

Use white screen hdr image and generate ibl file with cmgen.exe to make the object bright as possible!
You can do lots of things with it!
Photoshop can edit hdr, exr and ... formats!

Related

Is there a way to make a dark/low light SceneKit scene?

I've searched and there doesn't appear to be a way to make a dark SceneKit scene... As in a scene with low lighting. I've removed all lights from my scene, set my autoenablesDefaultLighting to false, made sure it's unchecked in the storyboard, I even tried adding a black ambient light but that didn't do anything. Is there a way to make a SceneKit Scene with low/dark lighting??
Had to try this for myself, as it didn't sound right. Removing all lights from the default SceneKit game template does indeed result in a model lit with an ambient light. I expect it's some kind of default that kicks into action when SceneKit identifies you have no lights in your scene.
Adding a black ambient light doesn't seem to change this, however adding a single dark non-ambient (omni, directional, spot) does result in a dark scene. The following image is with a dark gray omni light, and no ambient light.
I don't think this matters too much in real use, you'd be unlikely to have a scene with no non-ambient lights. Certainly understand the confusion in this instance however.
SCNLightingModelConstant is worth a look.
The SceneKit demos (code provided at apple.com) from 2014 and 2013 are quite dark. There's plenty to learn from there.

Render water-paint in iOS

I have been working with OpenGL in iOS, and setting the colors with glColor4f(r,g,b,a) and then drawing my own color on a white UIImageView. I basically have a brush, which is then moved around my user's touch, and then it paints the color onto the canvas. But this color needs to be water paint (like smudged color)
Does anyone understand/knows how to get a water color like this app does, and how the background UIImageView has a texture on it?
https://itunes.apple.com/us/app/hello-watercolor/id539414526?mt=8
or checkout water paint in this. http://www.fiftythree.com/paper
I created a bounty on this as I am really having a hard time to grasp how to derive such smooth flowing colors out of the normal colors. Even if you guys point me in the right direction, or to some sample code on how I can get the effect of water-paint, it would be really helpful ^_^
And as a bonus, it would be also be helpful if you can point out to me how to get canvas on which it is painted on looks realistic, and blended with the paint? Does Blending/GLSL have to do with any of this?
Is there any sample project on this?
If you are still struggling with the basics of getting realistic looking water colors working, you may want to experiment/prototype in photoshop first.
http://www.zoepiel.com/tutorials/watercolor/ shows some very effective tricks for creating watercolor images with simple tools.
The most interesting one is to multiply a group of watercolor layers with a greyscale watercolor paper image. The texture of the paper makes some parts remain white, and other parts saturate with color, just like real watercolor.
Each layer remains 'wet' in the sense that the colors within it blend, but the layers are 'dry' with respect to each other.
She also explains some of her brush and blur settings and shows what they do.
Once you can produce the desired effect in photoshop, you'll have clear specifications of what you want to do and you'll be quite a bit closer to programming it out.
Looking at the examples you posted, it looks like they are using a simple Gaussian Blur with a radius of double your brush size. This may be an incomplete solution, but it's at least the first level.

Three.js plane geometry border around texture

I am building a 3D image viewer which has Three.JS plane geometries as placeholders with the images as their textures.
Now I want to add a black border around the image. The only way I have found yet to implement this is to add a new black plane geometry behind the image to be displayed. But this required whole-sale changes to my framework which I want to avoid.
WebGL's texture loading function gl.texImage2D has a parameter for border. But I couldn't find this exposed anywhere through Three.js and doubt that it even works the way I think it does.
Is there an easier way to add borders around textures?
You can use a temporary regular 2D canvas to render your image and apply any kind of editing/effects there, like paint borders and such. Then use that canvas image as a texture. Might be a bit of work, but you will gain a lot of flexibility styling your borders and other stuff.
I'm not near my dev machine and won't be for a couple of days, so I can't look up an example of my own. This issue contains some code to get you started: https://github.com/mrdoob/three.js/issues/868

How to select a triangle in XNA?

I have a triangle with a transparent background (png image) I want its color to change when selecting it.
The point is that the color should change only when touching the non-transparent part of the image.
This should be working when the image is scaled..
Any ideas please?
Thanks...
Since you do not know the exact size/shape of the triangle, you'll need to use Per-Pixel collision detection. The App Hub has a tutorial for that. It even works with scaled/rotated objects.
Hope it helps!

XNA How To Make Transparent Texture

I read and try that pure Magenta Color 255, 0, 255 in an image is automatically transparent, but unfortunately failed, is there anything should I setup first?
Also I read and try include alpha in a PNG Image, the strange is when I used it on a project it's work, but not on the other, what is likely wrong with the code?
Please kindly reply, thank you
For Magenta to be transparent, look at the properties of your image file. Right click in solution explorer, properties.
There is an option there to specify the transparent color to be used (magenta by default).
Then, there is the rendering to consider. How are you drawing your texture? With SpriteBatch, it is automatic, but you may have sorting issues. Check the order in which you draw your textures and the SpriteSortMode.

Resources