Tuesday, June 30. 2009
I was a bit lazy again today, but at least the OpenGL-part now handles the Ward BRDFs (by creating a Phong representation with 0.1 ambient, 0.7 diffuse and 0.3 specular). But because there was only one shader model I still have problems when switching the models. I will solve that and then start with the raytracer implementation.
Monday, June 29. 2009
Yesterday I have started to add the Ward BRDF as a shader model. I have finished the part I have to do in the model and even found a stupid bug which didn't occur until now as I only had one model and so didn't notice that I couldn't switch models. The next thing to do is to add a simple representation to the OpenGL part. Currently the program stops with an assert when I try to switch to the model as the OpenGL part has no clue of how to handle it. I intend to write a version for the GPU later, but first I will just use a simple Phong variant. For now it has to be enough to define it, I first want to see it in the raytracer. The results should be interesting, as this model has some advantages compared to Phong I am currently using. The first is, that it is a true BRDF(Bidirectional reflectance distribution function), that means it is physically plausible (I am careful to call something physically correct) as it is easy to make sure it never returns more light than is reached at a point. It also means that it is symmetric, a very important property for lighting (if you switch the light and the camera the material appears the same). The second is, that it contains glossy reflection and calculates those properties from the parameters it gets (diffuse and specular reflection and two factors for the distribution of normal). So I hope the results look much better than Phong I have been using to date.
Sunday, June 28. 2009
Today I didn't get much further on the rotational constructor as such as I had to change some support structures to make it possible to continue. The rotational constructor is the first modifier of the polyhedrons which uses its own selection object. All the others use one selection and it was sufficient. But the rotational constructor has a very special need, it is not interested in the regular selection of vertices, edges or faces. Instead it has to handle selection of the points and lines of the profile curve. To make that possible I had to break up some very old code. And that always takes a bit of time to think through and implement. Most of it should be working now, I think I am only missing one bit, the rendering should not show the vertices and edges. It currently does, but it shouldn't be hard to change.
Saturday, June 27. 2009
 Today I finished the implementation of the layered materials. Finally, this took a whole lot longer than anticipated due to a lot of bugs I have found. I hope the code is now better and I will never again have to do such a number fixes in elementary parts which were supposed to be correct. In the process of getting this stuff working I had to make some more changes. The UI of texture rectangle was not usable in the way I wanted to use it and so I changed it a bit. The current way is much better. Also there were still some bugs left in the layered materials as such. Even the UI still had a stupid bug. But now I think all is working and I can finally turn to a new feature.
Friday, June 26. 2009
I started to add a new constructor some days ago. This one will get a 2d curve and then rotate it around an axis creating a solid of revolution. I called it "rotational constructor" as I didn't find a better term (and checking what other 3D apps call it seems to prove the absence of a good name). The constructor is showing first results. I hard coded a default curve (a simple rectangle) and have started to implement the function which takes the curve and creates the surface. Currently the vertices are created and the edges are also there. So I only have to add the faces (and then the uv-coordinates) and this part should already be finished. The biggest issue will be to create the editor for the curve. But overall I hope it doesn't end like some of my other stuff in an endless series of changes.
Thursday, June 25. 2009
Still not finished with the constraining of the car to the track. I have continued with the geometry stuff and sure hope I slowly have all the necessary functions in the program. I am using my raytracer as a reference for those functions, as I am rather confident that they are correct. Today I added a class for line segments (bounded lines) and added the function to get the closest point on a line to a given point. The general case is implemented, the specializations for the ray and the line segment still need to be done.
Wednesday, June 24. 2009
I have also finished the second group of functions. And I think I am finished now, the other two groups don't need that modification. So now I could pull out the common code but I guess I will just leave it in and concentrate on testing the code. So I will try to actually use more than a layer for something useful.
Tuesday, June 23. 2009
And so here we go again. The first of the four functions now has been changed so refractions should work correctly with layered materials. I will also change the other three sets of functions. And I might make another change, as far as I see I can remove common code from all shaders which can be transparent and move it into one common function. I think it might be worth it.
Monday, June 22. 2009
I am still working on the cats paw. I need to move around quite a number of vertices. This is the thing I still need to work on, I need way too many time consuming small changes. I have missed some problems while I still had only a few vertices. The later you change those general problems the longer it will take to do so. But at least I have the impression I am on the right way. So even if it takes long I hope to create a nice cat.
Sunday, June 21. 2009
 I have today tested the refraction with a test image. You can see it to the left. The change I have made was to specify the filter color resulting from passing a length of the material which can be specified. To check the code and also if it is a useful interface I created six glass bars. In the top row I kept the thickness of the bars constant at 1cm, in the bottom row the thickness increases from 1cm to 2cm to 5cm. All six materials have the same design color, but in the first column the color results after passing 1cm of the material, the second after 2cm and the final column after passing 5cm. The results look ok, the first row shows how the filter color desaturates when the material is thinner than the construction depth. The second row shows, that the color actually is the same when the thickness and the construction depths match. So I am now rather certain that the refractions work correctly again. But I have also found a new little problem with the layered material. Again with the refractions, the direction of the ray leaving the material will not be correct when more than one layer is being used. I have an idea how to fix that problem and will try to implement it tomorrow to finally finish that stuff.
Saturday, June 20. 2009
I was quite lazy today, I modeled a bit on the cat (and crashed the program again), managed to move a camera in a way that I can't find the model (I will add a button to reset the camera to something sane) and then choose to not work on it any longer. But I did something else, I took some reference images. Nothing exciting, everyday stuff, like a drinking glass, a toothbrush, a vase and some bottles. But I hope that I soon find time to turn these images into models. Something I learned is, that modeling without a reference is really hard. And that finding good reference images is quite hard, as the useful ones are not interesting and so hardly anybody will upload them. I haven't decided yet if I should. If it turns out well, I will probably take more images in the future. I hope that using the images gives me more insight of how to take the images to be useful. And having a library of everyday objects ought to be useful.
Friday, June 19. 2009
I have worked on the refraction definition today. What I had was nearly uncontrollable. I think it is a bit better now, but I still have to check something. The refraction code has the ability to filter the light based on thickness of the material. It is only the first order solution, so I am only using an exponential function. Before I used a color in the UI which was abused so that the color components directly defined the constants in the filter. That made it hard to control. The UI always showed the inverse color of the filter (so if I wanted the filter to be green, I would turn green to a very low value and red and blue to a high one, the color shown would then be magenta). Also the density was not controllable at all. And finally the domain was limited to 0 to 1 (which is not sufficient). Now I do it a bit differently, I define the color of the filter depending on a specified depth. I think that should work better. But I also have one issue, the resulting color looks too light for me, it is as if the density was not correct. I will have to check the code again, but it could also be the result of tone mapping.
I managed to finally model a bit. I haven't rendered a new picture, but I seem to make some progress. The paw now has some toes and the overall outline seems to slowly get into the right shape. I had to change some things, I noticed too late that the reference images I had used was showing the leg a bit twisted to the outside. The reference should mainly show the skeleton of a cat and to show that of the paw the leg was shown twisted so the bones of the five toes can be clearly seen. But for modeling that is not a good way to do it. I want to give the model a skeleton and there it is hard enough to get it right without watching for even more details. I also noticed that some of my lines didn't fit and would result in problems later when animating the cat. So I fixed those. The last problem I saw was, that the overall form of the paw is not right when seen from behind. I hope to fix that tomorrow and then I will have to do some more detail work. I hope it ends in a nice paw and if it does I will render a new picture of the model.
Thursday, June 18. 2009
No, it is not done yet. I had problems with the four view and the cameras. The first try I did to align the four view ended in an unusable camera position, I had tilted the reference frame a bit so some modification would be a bit easier, but that way I lost the visual link to the reference image I use. So I did the alignment again (I always store files under a new name, so I can go back to an older version). This time not making the error to tilt the reference frame, it all looked good. Until I noticed, that I had forgotten, that I already had created a raw extrusion for the paw. But that was not fully aligned with the reference image and so I aligned the reference frame with an artifact. Ok, third try finally worked. The next step was to realign the cameras. They get moved with the reference frame, but as they were looking closely at details, three of the four cameras didn't even show the model. So I tried to find the model again and managed to crash the program. I am not sure why it happened, only when. It will probably very hard to find that bug. But I even managed to overcome that hurdle. So I now have finally managed to align my cameras. I didn't think I would need some hours to do that (frustration doesn't exactly speed up doing those things). So now I only have to model that paw.
Wednesday, June 17. 2009
I have worked on the layered materials in the last few days, but not written about it. It is still as boring stuff as it was before, but I have just finished integrating the last changes to properly support refraction. Now I only need to test it and then I hope that the layered materials are really, really finished.
|