Monday, May 2, 2011

Last blog post I guess

So, I am guessing this is the last blog post.
Here is the movie of my final presentation with VOICE. =S



And miscellaneous pictures:



And yes, that is it.

Bye.

Thursday, April 21, 2011

Slow Progress

This week I have been mainly working on cleaning up the code a little bit, the poster and playing with the parameters of my shader. 


I also am allowing more lights positioned on each side of the cube (it used to be 9 per side and now it cna be any number, although I am currently clamping that to 36 per side).


Now, I am trying to draw the actual lights (the "light bulbs" so to speak... ). I was thinking that I could draw them as spheres (since my lights are point lights) but I am wondering if I should add them to the vbo that holds the vertices of the scene or if there is another way. I don't like the idea of adding it to the vbo of the vertices because that means they would be added to the scene and considered during the geometry pass. Unless I can skip them then. 


After I get the lights in, I need to get the images I am using as source for the light color to render. That requires adding at least 1 extra texture and 1 mesh. I am guessing I'll need an ID to signal which object be rendered with which texture.


And that is it for now.


Summarizing the plans:
- Draw the light bulbs.
- Add at least on extra texture to be rendered.
- Finish the poster
- Make a movie
- Get over stage fright

Friday, April 15, 2011

Video!


Yes, moving lights. 9 lights, sunset. Only one side. I'll continue with the other sides now =)

Hmmm

I have been tweaking my shader and seeing different results and I picked one that I like. This one has no ambient contribution, and for those of you that know me it comes as no surprise that I like it since it is the darker variation.


Ok, I am off to making my lights move.

Thursday, April 14, 2011

Environment Lights in

I am loading photographs and and making lights based on the color of the photographs.
Here are a few screeen shots with phong and others with lambert.



The funny thing with the last 2 pictures is that the second one is with 12 lights and the first one is with one. I am guessing blending that many lights together desaturates the color, but I am not convinced. 


(This one is a cloudy sky, grayish/whiteish clouds with low Ns)

(High Ns)


My next step is to load different pictures (I am using just one picture now for all sides), and see how it looks for all 6 sides illuminating the scene. I am currently using only 4 sides (the last picture). The first and third picture are only from one side (top).


I also need to make lights move nicely. I am just swapping positions from each light but it looks very choppy. So I have to think about how to do it.


Also, I only have one material allowed so I might want to allow for more than one, but I guess it depends on how my obj loader is dealing with different objects in the scene and also on finding a way to link that on my side too. We'll see. I think it would be cooler if I can get shadows in instead of multiple materials hehe. But I have to see how this week plays off (midterms, projects, etc).


Plan for the week:
- Move the lights nicely
- Test how it looks better (more lights, more sides, more attenuation, more color, etc)
- Load different pictures per side (should be easy enough)
- More if I can fit that in

Thursday, April 7, 2011

So I got the lights working and moving. I am using glBlend to add all the lights' results. I will play more with it after I fix the camera.


I chose an extension. I am going to try to get environment maps working with this. Should be fun.


Plan for the week:
- Fix the camera
- Get an estimate for the frame rate
- Make a different scene with objects with different materials (although same texture..)
- Assuming everything works smoothly (it never does) I will create a better positioning of the lights and start getting photographs in, and so on.

Thursday, March 31, 2011

Lights and Texture


I finally have texture and lights in.


With one light: fairly strong light.


With 2 lights: still looks cool.


 With more than 2 (here 5) lights, the other lights start losing their strenght (their contribution to the scene is reduced). I am still playing with how I am combining all lights. I am currently trying 2 things.
- Accumulation buffer: Tends to work a little better but not quite and it is slower. (shown in the image)
- glBlendFunc: it usually is too smooth, but faster. I am using
           glBlendFunc (GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
   glBlendEquation(GL_FUNC_ADD);



If anyone knows of a way of combining the different lit scenes, let me know.

Plans for the week:
- get lights looking better for Beta review and hopefully some short animation with lights.
- decide on an extension and start researching it and working on it.

Thursday, March 24, 2011

Self Evaluation Post

I'll try to not sound so pessimistic, which is how I sound when I have to evaluate me.

I am obviously behind, but those are no news, we all knew that. This has obviously been a hard project for me and that little (or not so little) crisis I had during the semester didn't help at all.

I have most of the geometry passes done. I am currently working on getting textures to load and be drawn. Depending on how long this takes I would work on lights. Start with one light, then 2, then a bunch. After that make them move. At this point I believe the deferred shader would be done. As in what type of lights, I was thinking start with point lights since they are easier to implement.
I am HOPING I would have this done by the Beta review, but I am doubting it. It is taking me too long to get the texture to work. And knowing me, I'll run into weird problems with the lights.

So the idea is:


Beta Review:
Have texture in and be working on lights. Hopefully, I would only be missing some animation. Hopefully.

Poster Session:
Working on an extension. I need to figure out which one (yes, still). This will highly depend on the time left. I prefer to finish something if rather simple than have something incomplete.

CG@Penn Day:
Probably still working on the extension, but hopefully closed to done.

After that just work on whatever I have left to work on.

Progress2

I am still trying to get a texture in. For some reason it is just not working. If I knew the reason I could make it work.
Anyways. 
At least now I can have fun loading bunnies, dinosaurs, cubes and spheres. 
As for how I am dealing with textures now:
The OBJ loader is supposedly loading the texture. And does the whole generating, binding, "parametering" and glTexImage2D. So it should be straight forward for me, right? Just send it to the first shader. Well, no.
I have Texcoords ready to be used and I am also sending them to the shader so I can get the correct color from the texture. 
Sigh.

I guess I can just jump to plans for the week:
- Keep working on the texture. I refuse to give up.
- Get lights going. 

Wednesday, March 16, 2011

Progress

I am updating my blog today because I will be leaving for Seattle tomorrow after my first class, so no time.


I have the obj loader in and working. The cubes and bunnies look like cubes and bunnies and I can read in color and shininess from mtl files.


Specular is also working:
I think. My formula for it might be wrong since I have changed it so much to test things that it is very very likely to not resemble at all any specularity formula.


I am trying now to get a texture in but it keeps breaking when I load it into a vbo. And coming to think of it, I am loading it to a vbo because that is what I did with the material, and the vertices, and so on. I don't know if the size is too large or I am giving it a wrong pointer to the texture. My loader gave me a bit of a fight before it finally gave in a loaded the texture in the first place.


Plan for next week:
- Get texture in
- Make lights ( I would like any ideas/suggestions/opinions on this matter since I am not sure yet how I can use lights in the shader (as in, getting them into the shader to use), where is were I am assuming the computations are made).

Thursday, March 3, 2011

Getting the OBJ Loader Back In

I have good and bad news.
The good news are that I am rendering something, loaded using the obj loader. 
The bad news is that it is not what it is supposed to be.


Here is a cube:
And here is the same cube from a different perspective:
Now, if that weren't supposed to be a cube, it would be regarded as "cool!"

Then I tried with a quad and I rendered only the points:
So, as you can see, it has 3 points correctly positioned and one (very faint in the diagonal) that is not where it is supposed to. I checked the files and loading the obj and everything looks fine. I will keep working on this until my class.

Edit:

I have a cube but the normals are wrong. So, I think this is a bad case of normal-vertex indexing.


Plan for the week after spring break
- Try to get the obj in in order to use a simpler base geometry to test my code on. If this is taking me too long,  I'll just continue using the "street" scene.
- Work on specular
- If things go smoothly I'll do more things, but I somehow doubt it.


Friday, February 25, 2011

Alpha Review

Oops, with alpha review being today I didn't update the blog last night. Oh well.
So I have some progress. I discovered the depth, normal and position buffers, so I worked on the diffuse and specular. I ran into weird problems (I still do at times) with my diffuse being pink even if I didn't set any color. Then it became gray and I was happy and managed to change it to red through the shader (which I wasn't being able to do before for some strange reason) and when I took the color out it was pink again... So, I think I like it red.



I made a video for the review, that I am uploading to you tube later I think.



My plans for the future are to get the OBJ loader in again (I had to ignore it for a while because I need to set up some VBOs and VAOs for the mesh and I felt the buffers were more important), work on the specular and get some lights in.
After that I will try to have my diffuse be a texture and then decide on the extension. I was thinking reflectance fields or light volumes, but I am open to suggestions (please?).

Wednesday, February 16, 2011

The shortest week/post

I have no pictures to show. Mainly because there is no visible progress.
I have been trying to get the buffers in but I guess there is a lot I need to learn about shaders and GLSL.
Plus I have been sick which totally ate my week from Thursday to Monday...

I found today shaders for deferred shading that come as part of the orange book examples so I guess I could use those. Unless, of course, it is wrong.

And I went from having a black screen to having a gray screen back to having a black screen. I am going to go ahead and pretend that is some progress.
Hopefully I get better soon and can actually work more on this.

So plan for next week is the same as the plan for this week:
-Get the buffers in (somehow)

Thursday, February 10, 2011

Another week

On this week's issue we have triangles, in different shapes and colors. We also have a teapot.

I played with the GLSL examples, the triangle one, and changed its color:


Made it smaller:

Since one wasn't enough, I made 2 of them:




 And that was it with the samples.

I then looked into a frame buffer tutorial, made it a project, went step by step and I got a rotating teapot:

And I also read some more. I am re-reading some of my resources since I am closer now to actually doing something that directly has to do with deferred shading.
The end.

I am now in the process of adding the frame buffer to my project. I had it as a Windows Application, hence the GUI, but I think I am changing it to a console application (bye bye GUI). We'll see how that goes. (Opinions, anyone?)

And that is that.

Plan for next week:
- get the frame buffer in, at least depth pass

Thursday, February 3, 2011

Some Progress


This past week I have been focused on catching up on GPU concepts and getting the OBJ loader in.

OBJ Loader stories:
I decided to use glm as the loader. But I figured a GUI would be helpful. So, I mixed glm and GLObjViewer and got glmObjViewer, or something. I am basically using the UI from GLObjViewer (since it has the window and the menu nicely in place) and glm as the actual loader. So, I have a bunny!



Joe just told me something to get the models exported from maya as obj to have reasonable .mtl files. I should have a Cornell Box with a sphere and/or cube inside soon enough.
So this part is sort of done, except that now I have to merge this with another project that will help me get up to speed with GPU programming.

Reading stories:
These are boring. I have read. I went through a simple tutorial on GPU concepts, read 2 more things about deferred shading again (to refresh my mind) and I am now in the middle of reading 2 tutorials about framebuffers.

Plan for the week:
-       Merge the 2 projects and play with them (or it, since I am merging them…).
-       Finish reading about framebuffers and start implementing.
-       Anything else that comes up and demands my urgent attention.

Friday, January 28, 2011

One honest, rather annoying blog post



Summarizing this week: a bad start.

I know, this is just the beginning, should be straightforward, etc. Well, no.
I have been trying to get an OBJ loader and build the framework for my project but encountered some difficulties. 
I was first using an OBJ loader that was already a project on its own, but since I didn’t know what was happening in most of the code, where the shading began, where it ended, where the loading ended and so on, I switched to one that was a group of files. Once I finally got it to compile, it wouldn’t show anything. So, debugging time. After trying to figure it out for 2 sessions, I decided to go back to the one that came in a project. That was Thursday night. Yay for me, back to the beginning of this week, but without the rest of the week to actually make some progress. 
So, my plan on that matter is to use that project, keep everything there and figure out what to erase once I have the framebuffer stuff in. Hopefully, I will be able to get over the dizziness of having so much code in one file. If not, well, I’ll use the infallible Plan C, which I have to devise once I need it. I know, I know, I am very indecisive and can’t really plan things. Oh, and if I only knew how to set up projects in VS…

About the reading part of my plan:
I have a hard time learning anything from reading or sitting in lectures. The only thing that sometimes works in this scenario is to read the material many many times until it sinks in. I am currently on Pass #3 of all my resources. I have summaries, diagrams, tables, etc. Now I only need to understand the material, which means read some more? I might need another Plan C here.
Good thing though: 
I realized there are a lot of things I should know in order to even start reading about deferred shading. Like GPU stuff and shading basic concepts. I learnt this week that the GPU stores data in 2D arrays called textures. So, when in my sources it says floating point textures it means (sort of) a 2D array of floating points (right?). Most of you know this already… if not all. But you are all great, which explains it =). So, now I am going over some concepts and re-reading my resources.

Plan for this week:
-       Read some more… a lot more…
-       Go over frame buffer tutorials
-       Revise my design document (It might help me understand more)
-       Prepare some questions for Joe (sorry Joe!)
-       HOPEFULLY, actually start coding… (unrealistic, but one gotta hope)
-   Find some advice on learning and understanding. Perhaps from my Human Memory Professor?

Thursday, January 20, 2011

Senior Design Abstract and Plan for First Week


Abstract

The purpose of this project is to get familiar with a different rendering technique. Deferred rendering is widely used in real-time rendering where the speed of performance is very important. Games are not the only application deferred rendering has, but they are great examples of its advantages. Implementing a deferred shader is the main focus of this project with the addition of some extension to it like reflectance fields or light volumes.
Having many lights in a scene is very complicated and normally costs time to calculate. Deferred shading renders multiple lights in real-time without trading performance. Games use this technique to defer light computations with screen-space operations. This technique separates the typical shading process into two discrete steps. One is computing geometry and determining the characteristics of the surface material, and the second calculates the light and computes the interaction between surface and light.
A deferred shader stores the surface information such as position, normal, etc. in a G-buffer in an initial pass. Then, for each light, if it has a non-zero contribution, the light shader will read the G-buffer, evaluate the current light’s contribution and add it up.
I plan to implement an extension to my renderer. I wish to take advantage of reflectance fields or light volumes. These illumination basis functions will re-light an object from a new set of light sources and hopefully enhance the deferred renderer.


Plan for week of Jan. 24th
  • Doing background reading
  • Setting up the framework
  • Integrating an OBJ Loader with my project