Hey
I've read somewhere about fft bokeh (lens) blur. I'm trying to implement it. I'm totally new to fft and stuff.
I managed to successfully fft an image, I have an 2d array of complex numbers.. when I do a backward fft, I get the same image as before, so it works.
How can I filter it to get a bokeh effect?
- Viewing Profile: Topics: MrOMGWTF
Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics
Community Stats
- Group Members
- Active Posts 92
- Profile Views 1,693
- Member Title Member
- Age 14 years old
- Birthday February 11, 1999
-
Gender
Male
-
Location
Poland
-
Interests
Global Illumination
367
Good
User Tools
Contacts
MrOMGWTF hasn't added any contacts yet.
Latest Visitors
Topics I've Started
Lens blur in frequency space
10 November 2012 - 05:32 AM
C# OpenTK - VBO problem :(
21 October 2012 - 07:58 AM
I've spent like freaking 1 hour trying to fix this problem, nothing worked.. eh..
After implementing my VBO class, I decided to give it a try. But somehow, nothing renders on the screen!
My VBO is a one simple triangle. I have no idea why isn't it working. It's OpenTK.
Here's my code for VBO:
And code where I test the VBO:
The syntax is similar to OpenGL's one, so even if you don't know OpenTK, I think you could help me
Thanks
@edit
OH MYYYY GOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOD
I'M LOADING THE PROJECTION MATRIX IN TO THE MODELVIEW MATRIX
FUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
@edit2:
GUESS WHAT
I FIXED THAT
.
.
.
AND IT STILL DOESN'T WORK ;_;
After implementing my VBO class, I decided to give it a try. But somehow, nothing renders on the screen!
My VBO is a one simple triangle. I have no idea why isn't it working. It's OpenTK.
Here's my code for VBO:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenTK.Graphics.OpenGL;
using OpenTK;
using System.Runtime.InteropServices;
namespace CentipedeRenderer
{
public class VBO
{
public int VertID = -1;
public int IndicesID = -1;
public int VertCount;
public int IndicesCount;
public void Create(List<Vector3> vertices, List<uint> indices)
{
VertCount = vertices.Count;
IndicesCount = indices.Count;
Free();
GL.GenBuffers(1, out VertID);
GL.GenBuffers(1, out IndicesID);
//pass the indices
GL.BindBuffer(BufferTarget.ElementArrayBuffer, IndicesID);
GL.BufferData<uint>(BufferTarget.ElementArrayBuffer,
(IntPtr)(indices.Count * sizeof(uint)),
indices.ToArray(),
BufferUsageHint.StaticDraw
);
//pass the vertices
GL.BindBuffer(BufferTarget.ArrayBuffer, VertID);
GL.BufferData<Vector3>(BufferTarget.ArrayBuffer,
(IntPtr)(vertices.Count * Vector3.SizeInBytes),
vertices.ToArray(),
BufferUsageHint.StaticDraw
);
}
public void Draw()
{
GL.EnableClientState(ArrayCap.VertexArray);
GL.BindBuffer(BufferTarget.ArrayBuffer, VertID);
GL.VertexPointer(3, VertexPointerType.Float, Vector3.SizeInBytes, 0);
GL.BindBuffer(BufferTarget.ElementArrayBuffer, IndicesID);
GL.DrawElements(BeginMode.Triangles, 3, DrawElementsType.UnsignedInt, 0);
}
public void Free()
{
GL.DeleteBuffers(2, new int[] { VertID, IndicesID } );
}
}
}
And code where I test the VBO:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenTK;
using OpenTK.Graphics.OpenGL;
namespace CentipedeRenderer
{
public class Renderer
{
public static Renderer GRen; // Global RENderer
public Scene Scene;
VBO testvbo;
public Renderer()
{
GL.Enable(EnableCap.DepthTest);
Matrix4 proj = Matrix4.CreatePerspectiveFieldOfView(MathHelper.PiOver4, (1280.0f / 720.0f), 1.0f, 100.0f);
GL.MatrixMode(MatrixMode.Modelview);
GL.LoadMatrix(ref proj);
testvbo = new VBO();
List<Vector3> verts = new List<Vector3>();
List<uint> indies = new List<uint>();
verts.Add(new Vector3(0.0f, 0.0f, -5.0f));
verts.Add(new Vector3(0.5f, 1.0f, -5.0f));
verts.Add(new Vector3(1.0f, 0.0f, -5.0f));
indies.Add(0);
indies.Add(1);
indies.Add(2);
testvbo.Create(verts, indies);
}
public void Render()
{
GL.Clear(ClearBufferMask.ColorBufferBit);
testvbo.Draw();
}
}
}
The syntax is similar to OpenGL's one, so even if you don't know OpenTK, I think you could help me
Thanks
@edit
OH MYYYY GOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOD
I'M LOADING THE PROJECTION MATRIX IN TO THE MODELVIEW MATRIX
FUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
@edit2:
GUESS WHAT
I FIXED THAT
.
.
.
AND IT STILL DOESN'T WORK ;_;
OpenGL Framework/Helper library
20 October 2012 - 07:02 AM
Hey, do you know any free to use OpenGL libraries that provide this kind of framework:
- FBO class
- VBO class
- Texture class
- Shader class
- Model loading
- etc.
You know what I'm talking about?
D3D has much more features than OpenGL... I don't really have time to write this kind of framework myself.
- FBO class
- VBO class
- Texture class
- Shader class
- Model loading
- etc.
You know what I'm talking about?
D3D has much more features than OpenGL... I don't really have time to write this kind of framework myself.
Creating instance of the class, as a pointer or not?
20 October 2012 - 02:18 AM
Hey, I wasn't coding in C++ for A LOT of time, I was coding in C#.
Today I decided to switch back to C++.
I don't know what to do:
There is a global variable, renderer. It's declared as extern in a header file, so I can use it from other files.
And now, should I declare it like this? :
Maybe it's a stupid question but it's a dilemma for me :s
Which option is better?
Today I decided to switch back to C++.
I don't know what to do:
There is a global variable, renderer. It's declared as extern in a header file, so I can use it from other files.
And now, should I declare it like this? :
.h extern Renderer* renderer; .cpp renderer = new Renderer;Or like this:
.h extern Renderer renderer; .cpp renderer = Renderer();
Maybe it's a stupid question but it's a dilemma for me :s
Which option is better?
Generating height/normal/etc maps from 2 images
06 October 2012 - 02:40 AM
O hai thar
I'm thinking about creating a tool for my engine, that creates normal/height/etc maps from 2 stereo images, just like this software: http://www.photosculpt.net/
That software's just damn awesome..
But I have no idea how to do this.. Any suggestions?
I think it's based on some kind of luminance difference, or what..
I'm thinking about creating a tool for my engine, that creates normal/height/etc maps from 2 stereo images, just like this software: http://www.photosculpt.net/
That software's just damn awesome..
But I have no idea how to do this.. Any suggestions?
I think it's based on some kind of luminance difference, or what..
- Home
- » Viewing Profile: Topics: MrOMGWTF

Find content