Multiple transparent textures on the same mesh face in Three.js

Use ShaderMaterial and set both textures as uniforms, and then blend them within shader. I made this example: and that really should be enough. So, you make ShaderMaterial: var vertShader = document.getElementById(‘vertex_shh’).innerHTML; var fragShader = document.getElementById(‘fragment_shh’).innerHTML; var attributes = {}; // custom attributes var uniforms = { // custom uniforms (your textures) tOne: { … Read more

blend two uiimages based on alpha/transparency of top image

This is what I’ve done in my app, similar to Tyler’s – but without the UIImageView: UIImage *bottomImage = [UIImage imageNamed:@”bottom.png”]; UIImage *image = [UIImage imageNamed:@”top.png”]; CGSize newSize = CGSizeMake(width, height); UIGraphicsBeginImageContext( newSize ); // Use existing opacity as is [bottomImage drawInRect:CGRectMake(0,0,newSize.width,newSize.height)]; // Apply supplied opacity [image drawInRect:CGRectMake(0,0,newSize.width,newSize.height) blendMode:kCGBlendModeNormal alpha:0.8]; UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); … Read more