Raytracing shadow/shading artifacts - shadow

I am trying to write raytracer but actually I have some problem.
I have data structure for smooth triangle mesh and there is problem with shadow/shading (images)
http://ubuntuone.com/5PzgIFMPofsUfSusGE25jt
and
http://ubuntuone.com/0M37JviVUKiwu5b5iBhFKS
I know where is the problem. By interpolated normal is part of triangle "on light" but for shadow ray is triangle flat and it is in shadow.
Question is, how I can remove this artifact.
Thank you for the answer.

This is a well-known artifact. You can see this page for a complete description as it relates to POV-Ray.
One potential solution, as mentioned there, is to have that object not cast any shadows. If it is part of a larger scene, perhaps have it cast shadows on other objects, but not on itself.
That page suggests a more complicated general algorithm as well, in the last section.

Related

AS3 Outline with glowfilter on partly transparent objects

My problem is that I have some objects I want to create a highlight around. Currently I am using glowfilter to do this, it works perfectly fine most of the time. But when I have partly transparent objects I get a problem, for example, a window, since the glass in the window is transparent the glowfilter will be visible through it.
Is there a solution on how to make a nice outline, without having to worry about transparency?
Thank you in advance!
OK there are two answers, one is easy and non-coding based, and the other requires the first answer plus coding and is non-trivial.
Easy answer: Don't use transparency. Flatten the source image, copy your part, and put a GlowFilter on it. Simple, and probably the way you should go.
Not easy answer: What you're seeing is the normal behavior for Bitmap filters. Instead, you will need to use a combination of at least two bitmaps, one without any interior transparency (same image part as in the Easy answer) that uses a GlowFilter with the knockout parameter set to true, and the other identical bitmap, without a filter, placed directly over it if you are intending to slide things between the device and the highlight. Doing this is way beyond the scope of a simple question, and you should research it if the Easy Answer doesn't do it.

Add glow to Image (Actor) in LibGDX

Is it possible to add a glow to the outline of an Image? I know I can do this by adding an additional "glowed" version of the image and switching to it when desired, but since there are many different shapes in my game, I would prefer the glow to be done programmatically. How can I do this?
As #Metaphore mentioned, shaders are indeed the best option I found. I've succeeded in adding an outline to any desired image in my game by following this article and by getting crucial information from asking a follow up question.
The only way to do this is to use your own pixel shader when drawing this particular image.
You can find a lot of glow effect shaders on the net and there are may tutorials how to use them as well. You may check official LibGDX article on this topic https://github.com/libgdx/libgdx/wiki/Shaders
However, I'd not recommend you follow that way, because using different shaders for drawing single images will make you render cycle code much more complicated and less optimal. So either you will compromise on it, or just find easier way to achieve such behavior without shaders (I mean draw it statically somehow).

how to achieved sprite reflection in libgdx

I am currently working on an open world game like pokemon using libgdx.I am currently stuck on this effect that I really want to be done before moving to other features of my game. do you have any idea how to achieve this reflection effect? .concept behind?
https://gamedev.stackexchange.com/questions/102940/libgdx-sprite-reflection
For basic reflection, to draw a texture flipped vertically you can simply scale its height by -1. Then simply redraw the texture an appropriate distance under the player.
You shoudl also add a clipping rectangle around the water's edge so the reflection only draws where the water is. For perfomance purposes, it would also be good to only do this when the player is near water.
I can't give you actual code as I don;t know anything about your code, but once you've had a go at handling reflection as abaove, come back here and ask any more specific questions taht you may have.
This question is too broad and opinion based and hence is highly likely to be voted down.

Moving an object in elliptical Path

In my LigGdx based game, I wish to move my Sprite in an elliptical path to reach the destination. I do not find any support in Universal tween engine. Sample of route example is shown below.
Questions :
Is there is any methods in UniversalTween Engine to have a elliptical path ?
Also let me know what is waypoints in UniversalTween Engine ?
Thanks in Advance !
The Universal Tween Engine now supports curves - Default is CatmullRom which would definitely be able to provide the smooth movement you want.
It's a little tricky to get your head around at first but not that bad once you get used to it.
Universal Tween Engine
Details of update that added curves
Well I have searched up this question for you and discovered you many people have already asked this question, and none of them got an answer, yet. So I will try to answer as best as I can. I believe that my method is not the best. But if your application is not time or performance sensitive, then this method may work.
Now this comes to a math problem. You know that the screen is make out of pixels and there is no point making it overly detailed because it isn't possible. So you can do this:
They grey line being your intended line, and the green line being your actual drawn line. If you move objects using the tween engine along the green path and switch path when hitting the red dots. You could mimic an elliptical movement. However, you need to use math and calculate your path. You could set the coordinates of your path as a constant for every screen size, or you could calculate it every time.
Overall, the more points you calculate, the more elliptical the movement will be.
Anyways if you look at this website, it teaches you how to tween.
You can use Tween.to(...); to help you tween to the points.
Hope this helped you

Animating a path between two objects on HTML5 canvas

We're developing a game with impactjs that allows 'chaining' of entities as they are clicked. Basically this just draws a line between the two points, with a neon glow effect. So far, so good. Now, we have a request to make the 'chain' connections animated - fire, sparkles, etc. Essentially things that seem like they'd need actual graphic animations to look right. As the entities can be any distance/angle from each other, we're stuck at how to best implement a solution for this - that is, how to draw a diagonal image, for example, between two random points that we can animate. Any thoughts our suggestions on how to pull this off would be much appreciated.
Maybe create a particle entity with an Animation Sheet containing the necessary animations/particle effects. And then draw these particles along the line that from point A to point B.
When you want to animate it to fire/sparkles etc. run the animation for all those entities. in that line.
I'd be inclined to agree with Prat. Particle effects would most likely be what you need.
Here is a tutorial on generating particle effects in impact.js that might help you out.
http://www.pointofimpactjs.com/snippets/view/24/particle-effects-generation