Is it possible to change meshes opacity in JavaFX 8? I've tried to use setOpacity() and opacityProperty() of MeshView but it seems there is no result.
Transparency/opacity support is still under development and will not be available in the first GA-release in 03/2014. See issues RT-28874 and RT-34356.
Related
I'm trying to make an auto landscape material with 4 materials. If I use 3 materials it blends as expected but if I try blending a 4th I get the default texture when I compile. There are no compilation errors.
The really odd thing is that my normal maps and displacement maps still blend properly. If I put a solid color into the base color output and light the scene I can see that the materials are where I want them to be, but if I put the blended base color I get the default texture with no normals/displacement.
Is this expected behavior or is it a bug? I'm not using landscape layer blend since I want to set the masks procedurally.
I solved this. If anyone is looking for a solution to this, the issue was I needed to set the sampler source to "Shared:wrap" on my texture samples.
Overview
I'm working on a shader in Unity 2017.1 to enable UnityEngine.UI.Image components to blur what is behind them.
As some of the approaches in this Unity forum topic, I use GrabPasses, specifically a tex2Dproj(_GrabTexture, UNITY_PROJ_COORD(<uv with offset>)) call to look up the pixels that I use in my blur summations. I'm doing a basic 2-pass box blur, and not looking to optimize performance right now.
This works as expected:
I also want to mask the blur effect based on the image alpha. I use tex2D(_MainTex, IN.uvmain) to look up the alpha color of the sprite on the pixel I am calculating the blur for, which I then combine with the alpha of the blur.
This works fine when working with just a single UI.Image object:
The Problem
However when I have multiple UI.Image objects that share the same Material created from this shader, images layered above will cut into the images below:
I believe this is because objects with the same material may be drawn simultaneously and so don't appear in each other's GrabPasses, or at least something to that effect.
That at least would explain why, if I duplicate the material and use each material on its own object, I don't have this problem.
Here is the source code for the shader: https://gist.github.com/JohannesMP/8d0f531b815dfad07823d44bc12b8112
The Question
Is there a way to force objects of the same material to draw consecutively and not in parallel? Basically, I would like the result of a lower object's render passes to be visible to the grab pass of subsequent objects.
I could imagine creating a component that dynamically instantiates materials to force this, or using render textures, but I would really like a solution that doesn't require adding components or creating multiple materials to swap out.
I would love a solution that is entirely self-contained within one shader/one material but is unsure if this is possible. I'm still only starting to get familiar with shaders so I'm positive there are some features I am not familiar with.
It turns out that it was me re-drawing what I grabbed from the _GrabTexture that was causing the the issue. By correctly handling the alpha logic there I was able to get exactly the desired behavior:
Here is the updated sourcecode: https://gist.github.com/JohannesMP/7d62f282705169a2855a0aac315ff381
As mentioned before, optimizing the convolution step was not my priority.
I have a problem when using the projector with an image as a texture. How to set wrap mode neither to repeat nor to clamp texture?
I want to get this:
and not this:
(Images are from this tutorial)
I run into few solutions to this problem and all of them use Advanced Texture Type which is not available in newer versions of the Unity.
"...What you'll want to do in that case is go to your texture, change the type from Texture to Advanced..."
Is there any replacement for that problem?
EDIT:
As #Gunnar B mentioned, I haven't realized that in the tutorial 1px border is used, so selecting Advanced is not a solution to the problem.
So my question is how to get projection as seen in the first image without adding the border?
I am trying to target a wide range of resolutions for a 2d titles we are starting to work on with Unity. I previously worked with different middlewares and I am trying to achieve something like the 'Fixed Height' strategy that can be found in Cocos2D-X (http://www.cocos2d-x.org/wiki/Multi_resolution_support).
I would like to know, in your opinion, what would be the easiest way to support a wide range of resolutions and display ratios using a minimum of different graphical assets with Unity 4.3 for a 2d title.
Thanks
If you could not use UGUI, you can select NGUI or other GUI engines. NGUI support fixed resolution with UIRoot. For examples, you can setup scaling style to Constrained on mobiles, content with to 960 fit, content height to 640 fit in UIRoot.
Otherwise, if you can select UGUI, you can use more flexible methods like Canvas Scaler, Rect transform.
I need to create good looking lightning using OpenGL ES 1.1 (iPhone) and was planning on using shaders. However, when I asked about it in a previous question (OpenGL ES 1.x Shaders) I was informed there that this was probably not an option on the iPhone.
So now I am back at square one, wondering how I might make a lightning animation. It does not need to look ultra-realistic. I have already tried to use things like triangles stripped together. While this method does work, it is not as good as I had hoped it would look.
Does anyone have any ideas on the subject?
Thanks again,
~Eric
Try using a triangle strip textured with a gradient from black to a low-saturation blue or purple, to white. Set your blending to additive (GL_SRC_ALPHA, GL_ONE).
The usual approach is to compute the path of the lightning bolt using a Perlin function, rendering it to a glow buffer, creating a nice looking blur using a Gaussian blur shader and then merge it with your scene.
You could maybe adapt the code from this project. Although it's not ObjC/C, it does use OpenGL.
Here is an article that describes the effect in more detail and provides a VB/DirectX implementation.
Maybe I'm missing something but what's wrong with simply using glLight() and the fixed functionality like everybody else?
Would have to be a very bright light to make it look like lightning and wouldn't you need to shine the light on or through something?