ok, so, we are having problems with our current mirror reflection implementation.
At the moment we are doing it very simple, so for the i-th frame, we calculate the reflection vectors given the viewPoint and some predefined points on the mirror surface (position and normal).
Then, using the least squared algorithm, we find the point that has the minimum distance from all these reflections vectors. This is going to be our virtual viewPoint (with the right orientation).
After that, we render offscreen to a texture by setting the OpenGL camera on the virtual viewPoint.
And finally we use the rendered texture on the mirror surface.
So far this has always been fine, but now we are having some more strong constraints on accuracy.
What are our best options given that:
- we have a dynamic scene, the mirror and parts of the scene can change continuously from frame to frame
- we have about 3k points (with normals) per mirror, calculated offline using some cad program (such as Catia)
- all the mirror are always perfectly spherical (with different radius vertically and horizontally) and they are always convex
- a scene can have up to 10 mirror
- it should be fast enough also for vr (Htc Vive) on fastest gpus (only desktops)
Looking around, some papers talk about calculating some caustic surface derivation offline, but I don't know if this suits my case
Also, another paper, used some acceleration structures to detect the intersection between the reflection vectors and the scene, and then adjust the corresponding texture coordinate. This looks the most accurate but also very heavy from a computational point of view.
Other than that, I couldn't find anything updated/exhaustive around, can you help me?
Thanks in advance
protected void menuImage_ChildClick(Object sender, EventArgs e)
if(pbxPhoto.Image != null && sender is MenuItem)
MenuItem mi = (MenuItem)sender;
pbxPhoto.SizeMode = modeMenuArray[mi.Index];
I'm trying to make one click function to handle multiple menus. Using this code does not work when I click the menu buttons after the image is loaded in the picture box. Here is where I set the event handler of both menu items.
this.menuStretch.Name = "menuStretch";
this.menuStretch.Size = new System.Drawing.Size(152, 22);
this.menuStretch.Text = "S&tretch to Fit";
this.menuStretch.Click += new System.EventHandler(this.menuImage_ChildClick);
this.menuActual.Name = "menuActual";
this.menuActual.Size = new System.Drawing.Size(152, 22);
this.menuActual.Text = "&Actual Size";
this.menuActual.Click += new System.EventHandler(this.menuImage_ChildClick);
Menu Stretch and Menu Actual are ToolStripMenuItems, which don't have an index variable as I've noticed. How do I get this to work? Otherwise I have to make a separate event function per menu item, which, depending on the amount of image properties, could be a a lot.
I need a simple(ish) MP3 player for my C# WPF project. Sound isn't a major player in my project, but I do need to be able to play a couple of MP3s at the same time (loaded in as Content).
I'm currently using the standard MediaPlayer library just to get a placeholder in there, but it does not meet these requirements:
* Looping - no matter what I try, there's always a split-second break in the sound when it comes to looping (a few of the sounds are short tune loops, and the brief pause when looping really stands out like a sore... ear...!)
* Mixing - at times I need to play a couple of samples simultaneously, but I don't believe MediaPlayer can support this. Having said this I've not tried invoking more than one MediaPlayer class at the same time.
Are there any suggestions? I've browsed through NuGet but I'm surprised I can't find anything really useful.
Hi everyone! I'm currently working on a series of books about 2D Shader Development.
The idea is to synthesize a bunch of techniques that are specifically useful for 2D, even if they work on 3D as well.
I released the first book last week. It's 4.99 on Amazon or free on the series website, https://www.2dshaders.com
This is an independent initiative, I don't work for any publisher whatsoever. The contents of the books are the result of a 4-year span where I started teaching this in Argentina and USA, always making the workshop better. Now I'm expanding it to make more sense in book form.
I'd love to hear your opinions on the idea and if you get the book let me know what you think.
By the way, the examples are in Unity, but the concepts from the book should be easily transferable to any graphics api/engine.