top of page
Procedural Houses

Assignment: Model a house and then use code to duplicate it, as well as use OSL shaders to randomize colors of the different piece of the house.

WIPs and Process
2.png
ref.jpg

First I started out with modeling my house, going off of this reference photo. I also decided to go with a color palette consisting of dark grays, whites, and blues for the majority of it. Then I put the pieces into the following groups: roof edges and window frames, window glass, doors, main building, and roof.

1.PNG
3.PNG

Next I started working on the code that would allow me to duplicate my house. I got it working on cubes first and then moved on to my house, making sure to account for the fact that my houses sat on a 4x4 plane of grass, so I had to factor that into the movement of the houses.

4.PNG

Next I got my code working with randomly assigning colors. I did this initially using plain randomized AI Standard Surface shaders, but then I would later change it to work with OSL to fit the project requirements. I also fine tuned it so that I would be able to change the colors and still have them fit the general 'blue walls, dark blue roof, white windows and edges.

houserender.png

Finally I ran my code and let it do its thing. Everything ran smoothly once I ironed out the bugs in the code. Below is a video on the code working and running smoothly, as well as screenshots of the code so you can see just what is going on behind the scenes.

5.PNG
6.PNG
Capture.PNG
Final Thoughts

I don't think I ran into any major hurdles. It was more like a bunch of little ones that I had to do some troubleshooting and problem solving on, but I managed them pretty well in my opinion. For example, the setAttr function didn't like it when I tried to use variables for the RGB values, and I had to set them manually, and that's why I ended up with different functions for each object. But that being said, the separate functions did come as my solution to the problem. This project definitely had me working to figure out solutions to all the little problems that popped up, but I didn't think that it was unmanageable at any point. If I had more time I probably would've tried to do something with lights being either on or off inside the house, or maybe a more complex house model to begin with (though I'm really not a modeler). Overall, I was pretty satisfied with the end result.

bottom of page