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.