Unity Issue Shadow Caster 2D - light

I'm having this issue when working with the new Shadow Caster 2D in Unity.
https://www.youtube.com/watch?v=tvUNsYCVeIM&feature=youtu.be

A quick fix is to increase the outer radius and raise the falloff intensity to max to compensate.
Dev told of another temporarely fix, which is to add a vertex to your shadow caster in the middle of each of your sides. I haven't tried it myself yet, as I've found solution 1 sufficient for testing purposes, but i'll probably try it out as some point.
Ultimately its a bug that they will fix it in time.
For futher questions regarding 2d Lights/Shadows I recommend the thread on Unity: link

Related

Keep textures from stretching when extruding faces in Blender?

I'm trying to make a map in Blender but I'm getting weird texture stretching problem when I extrude along some faces. I've enabled "Correct Face Attributes" in Options, and it helps, but in some cases I still get this stretching:
Any pointers on how I could fix this?
Found the perfect answer here: https://blenderartists.org/t/extruded-correct-face-attributes-texture-is-distorted/1270185
Using hex-planar UV mapping, things are looking as they should!
Fixed Screenshot

SharpDX How To Render a 3D Environment

I just started coding some basics in SharpDX (VB.net) and I already got it to Render a 2D triangle. And I know how to render other 2D stuff, but I want to create something in 3D where I'm able to rotate the camera around some cubes. I tried it, but failed at converting the 3D Space to screen coordinates. Now Here are my Questions:
How can I calculate a Matrix for Perspective projection?
How can I pass that Matrix to my Vertex Shader
How can I make the Camera rotate around the Objects when I drag the mouse over the screen?
Please explain these things to me and give some code examples. I'm just a Beginner in SharpDX and everything I found was just not understandable for me.
A few things you can do when you first start.
Firstly, there are some great examples you can leverage (Even in c# but you need VB) that you can use to learn from.
I suggest you look at this within the Sharpdx repository. Sharpdx direct 3d 11 samples
Within these examples (especially triangle example), it goes through the basics including setting up the device, the creation of simple resources to bind to your GPU and compiling the bytecode.
The samples though use the effects methodology, which is deprecated and as such once you become familiar with compiling code, I would advise moving away from this paradigm.
The more advanced examples will show you how to set up your matrices.
The last item you wanted to know about is mouse movement. I would advise just having a look at MSDN around mousemove events. You will need to bind one to your window/control and then read the deltas. Use those deltas to create your rotation/movement based upon this. Look into Vector3 (sharpdx), basically, you need to do this all in vector space and then create the various translation/rotation matrices from this.
Hope this is start.

libgdx tiledmap flicker with Nearest filtering

I am having strange artifacts on a tiledmap while scrolling with the camera clamped on the player (who is a box2d-Body).
Before getting this issue i used the linear filter for the tiledmap which prevents those strange artifacts from happening but results in Texture bleeding (i loaded the tiledmap straight from a .tmx file without padding the tiles).
However now i am using the Nearest filter instead which gets rid of the bleeding but when scrolling the map (by walking the character with the cam clamped on him) it seams like a lot of pixel are flickering around. The flickering results can get better or worse depending on the cameras zoom value.
But when I use the "OrthoCamController" class from the libgdx-Utilities which allows to scroll the map by panning with the mouse/finger i don't get these artifacts at all.
I assume that the flickering might be caused by bad camera-position values received by the box2d-Body's position.
One more thing i should add here: The game instance runs in 1280*720 display mode while my gamecam renders only 800*480. Wen i change the gamecam's rendersolution to 1280*720 i don't get those artifacts but then the tiles are way too tiny.
Has anyone experienced this issue or knows how to fix that? :)
I had a similar problem with this, and found it was due to having too small a decimal value for the camera position.
I think what may be happening is some sort of rounding with certain tile columns/rows in the tilemap renderer.
I fixed this by rounding to a set accuracy, like so:
camera.position.x = Math.round(player.entity.getX() * scalePosition) / scalePosition;
Experiment with various values, but I got it working by using the tile size as the scalePosition value.
About tilesets, I posted a solution here: Getting gaps between tiled textures with libgdx
I've been using that method with Tiled itself. You will have to adjust "margin" and "spacing" when importing tilesets in Tiled to get the effect working.
It's 100% working for me :)

Improve perfomance of my threejs

I have some issues about my model. Is is an easy model buy I can not make It work well...
I upload my project here: http://webgl.drapps.info
I have a car model with some pieces that change material when mouse is over them. I use threex.domevent.js library with "on" function. My model is loaded by json files.
Issue 1
when mouse is out of canvas, threejs detects that mouse is over a piece of my model, but this is not true, and that piece change its material (triggering mouseOver event).
Furthermore, I tried to get better mouseover event because even when mouse is really over a piece, that event doesn't trigger.
Issue 2
This is about TrackballControls. Is there any way to control rotation of my world? I mean: rotation only in one axis, rotation only for 180 degrees, etc... Is there any tutorial or article to learn how to rotate and translate camera?
Thanks for everything, I will so please to anybody who wants answer this... because I am a little lost
Thanks
Sorry, but you are out of luck.
Question 1. Yikes! You are using threex.js which is a third-party app that hasn't been updated in almost a year, so I can't help you with that.
You are also using an older version of three.js. Please update to the current version.
If you still have problems, post a new question with a simple demo -- not your entire project. Better yet, Google your question first.
Question 2. TrackballControls is not part of the library -- it is part of the examples -- so it is not officially supported. If you are not happy with it, you will have to hack the code yourself.
This question has come up a lot. Google it. To the best of my knowledge, there is not a good solution.
Personally, I would use OrbitControls in your case -- it keeps the scene right-side-up, and you can constrain the maximum polar angle, keeping the camera "above ground".
The best examples/tutorials are the official three.js examples, which will work with the current version of the library.
I can't help with issue 1.
Issue2:
I am also working on a project to visualize vehicles and needed to be able to rotate. I also tried Trackballcontrolls but it did not suit my needs.
What I ended up doing was creating a a master Object3d and then instead of adding objects/models to the scene, I added them to the master Object3d. That way to rotate everything in the scene, I just had to rotate the master object.
To actually do the rotation I just used the code from one of the cube examples.

OpenCV cvFindContours questions

I'm following this guide: http://www.aishack.in/2010/08/sudoku-grabber-with-opencv/2/
and modifying to iOS 5.0.
I managed to find the largest contour (the sudoku "board"), however, it only locates the surrounding square, without the lines inside, as in the tutorial. can this be easily solved?
I'll try and find a way around it, but still would like to know. thanks!
I assume that you are using the camera right now. Try to load the image what is used in the tutorial and check if your implementation works on that image. Then you can continue with nice sudoku images from the web. You may also change the camera angle and distance from the sudoku when taking pictures to get a better, clearer view.