Shadow artefacts with aframe directional light - aframe

I have a .glb model and I'm trying to get nice dynamic shadows working.
I've played around with all the settings and read the docs but this is the best I can do and I'm getting unpleasant artefacts.
Is it possible to achieve better results?
Demo: http://planetvr.shop/orchid-1.html

Related

Render 2D text in Autodesk Forge without aliasing or blurring

Turns out I’m working with the Autodesk Forge viewer and Three.js, trying to render 2D text that can be interacted with (specifically select, rotate, and move).
To do this I am working with meshes (using MeshBasicMaterial, Mesh and TextGeometry) but it turns out that the text does not look perfectly sharp, it presents aliasing and I found that according to the API reference, the antialiasing is not applicable to 2d.
Here are some examples of the problem, as you can see, the more I move away from the plane, the worse the text looks (and even up close it doesn't look perfect):
I have tried to make a test representing the text with a Sprite (despite the fact that it would mean having to change the entire implementation already made with meshes of other functionalities) but apart from the fact that I cannot see it, I have seen example images and they do not appear either well: aliasing is visible from a distance and it looks really blurry up close. Here some examples:
Is there a way to correct this problem or is this the most I can get in 2D? I've tried searching for information on this but can't find anything helpful. And what has puzzled me the most has been realizing that antialiasing was not applicable in the case of 2d, like making it clear that nothing can be done to fix it.
I would be very grateful if you could solve my doubts, thank you very much in advance for your help.
An easier alternative, is to just use a higher pixel ratio for the renderer...
window.devicePixelRatio=2;
viewer.resize();
For example, using the custom geometry text, from Joao's demo, you can see the same aliasing issue at DPR=0.5 and DPR=1.0 ...
https://joaomartins-forge.github.io/textgeometry-sample/
But when I set the DPR=2.0, the text looks clean. The trade off is rendering performance, but your 2D drawings may be simple enough that it won't matter. You can use a 'mouse up' camera settle trick, to switch between DPR of 1 and 2, if you want a better UX experience.
There are a few ways to solve this aliasing issue for 2D (and 3D text).
The way I would recommend for your use case, is to use DIV elements (THREE.CSS3DRenderer), instead of text converted into three.js tessellated triangle geometry, as shown in this blog post:
https://forge.autodesk.com/blog/how-do-you-add-labels-forge-viewer
You can find out more information about THREE.CSS3DRenderer here:
https://threejs.org/docs/#examples/en/renderers/CSS3DRenderer
and an Example here: https://threejs.org/examples/#css3d_periodictable
Using CSS3DRenderer instead of CSS2DRenderer, means you will get the correct scaling (and rotation) of the div element as you zoom into your 2D drawing and the mathematics inside the calculation for the matrix transform has less edge-cases.
Once you are using DIV elements for your text, you will notice that the text is sharper and has no aliasing issues. That's because it is not being rasterized by the webGL pipeline, but by the SKIA library used by chrome/firefox/opera/etc for rasterizing text.
There is one final option, that uses signed-distance fields, but it's probably overkill for what you need.
Let me know if you want some example code.

How to create hexogon shaped / neural network of photos

I'm having a tough time properly describing what needs to be done to make the below happen in CSS. Is there an effective way to do this in CSS with images? If so what is the proper way to describe this shape / layout? If no example, how would you implement this? Should it just be a png?
Did you have a look at:
Position icons into circle
http://hugogiraudel.com/2013/04/02/items-on-circle/
http://www.connolly-technologies.com/jquery-arrange-items-in-a-circle/
You also use transform: rotate(xxxdeg) in css to distribute the images evenly around.

creating a round list in CSS (for a round menubar)

I am really hoping someone can help me. I am trying to create a round menubar in CSS and I've searched and searched for solutions but have found nothing. I know how to create round areas (by setting the radius), and I know how to create a simple straight line menu using <ul> & <li> but, as said, I want to create a round one.
there is a picture of something alike what I'd love to get working:
If anyone could help me on this I'd be so thoroughly grateful.
Closest things I know of are these:
http://www.cssplay.co.uk/menus/cssplay-round-and-round.html
http://codepen.io/tgrant54/pen/lBHwK
Is that what you're after?
This menu looks almost like Path's Button.
You can find the link to Path's Button here.
You just need to modify it a bit so the menu displayed in full sphere.
This isn't something you really want to be doing in pure CSS.
You may be able to make circle shapes with border-radius, but you're not actually making a circular object -- it's still a regular box shape as far as the browser is concerned, just with the corners rounded off. This has absolutely no bearing at all on your ability to do anything else to do with circles or curves in CSS.
Yes, it's possible to do something along the lines you're after, by putting every character into its own element, and styling each of them with a specific position, but that's going to be painful, inflexible, and difficult to work with. If you really want to do this, there's a code generator you could try out here, but I'd say you're barking up the wrong tree.
If you want to do this kind of thing properly, what you really need to be thinking about is doing it in graphical format, using either Canvas or SVG, plus plenty of javascript code.
I'd suggest looking into a JS library like Raphael for this; there are people who have tried similar things already using Raphael, which may help you -- see here, for example: Radial Pie Menu With Raphael JS
Hope that helps.

How to add some CSS/html5 effects to give it the illusion of it being fiery?

I have just been trying out and sort of learning bits and bobs in html5. I basically have this little animation: http://jsfiddle.net/Hazza/dJgC9/4/ It is just some images falling out the sky repeatedly. Fun. I was just wondering if there was some way to make them look a bit more exciting. They are supposed to be meteors, or something. So I was looking to try and add the illusion of fire to them. I thought I could have a few different images with different CSS effects like blur and load them randomly as they fall. But it looked...yeah. Retarded. This was kinda the effect I was going for: http://gw2101.gtm.guildwars2.com/en/ . That is flash. And looks fancy as.
Is this at all possible do you think? Or is it something best left to photoshop and then alternate between a few different images? I suck at photoshopping. :D
Anyway I was just playing around for a bit of fun. I'm already secretly proud of my terribad little firestorm but hey, it's a start. Thanks for any input or insight.
Try this, my friend. http://mentadreams.com/2011/03/fire-effect-with-css3/

Flex / AS3 : Red Eye reduction

I was looking a component to reduce red eye effect on taken photos. Ive found an image Processing library, but it does not work well at all. I was thinking on brush an image, manually, and only paint if the base pixel color its red or near in RGB.
Have no time now to explain all the process, but i need help to get this idea, or to get a working comp
Thanks in advance!
If you are wishing to manipulate the pixels of an image/component then pixelbender would be a pretty good way to go.
Have a look at http://www.adobe.com/cfusion/exchange/index.cfm?event=productHome&exc=26 for downloadable examples.
These can be run using the toolkit found at http://labs.adobe.com/technologies/pixelbender/
Video tutorials on pixel bender can be found at http://www.gotoandlearn.com/
With this you could change just the required pixel colours to anything and it works with everything in flash (images, canvas, button's etc)

Resources