Live data from Hacker News

Stanford CS248: Implement an SVG Rasterizer

github.com

51–60 of 82 posts

Re: Stanford CS248: Implement an SVG Rasterizer

#51
post #50
post #49

Earlier quoted context omitted.

CS148 [1] varies from year to year (most people complained that I made the final assignment on subdivision surfaces too hard, but I had at least a few "Thank you, this was awesome") and is the pre-cursor to 248. I'd recommend it if you're getting started. If you like ray tracing, Cem Yuksel currently teaches most of the related courses at Utah [2]. [1] http://web.stanford.edu/class/cs148/assignments.html [2] http://w…

Sometimes I kick myself for not doing CS while I was at Utah. :(

There's tons of material online now. If you want a "traditional Utah graphics" curriculum, Cem is teaching most of the stuff (with updates!) from 15 years ago. You can also probably find the old course slides and assignments. I'd suggest cs6620, personally:

https://graphics.cs.utah.edu/courses/cs6620/fall2019/

Re: Stanford CS248: Implement an SVG Rasterizer

#52

The code doesn't strike me as very well structured nor documenten. Too bad, because it's an interesting challenge

It's pretty ridiculous and has a ton of just bizarre stuff you have to read through (and do!) to even get to something remotely interesting.

One of the first projects I "assigned" to myself when learning to program was to create a 3d environment and be able to scale, rotate, translate objects in 3d. It was easy and fun because I got to choose the language, the rules, etc.

This assignment makes me cringe a bit because there are a lot of hoops to jump through. But yeah, I guess, no pain no gain or something like that :)

Re: Stanford CS248: Implement an SVG Rasterizer

#53

Does anyone know similar courses where you get to do similar kind of practical assignments?

CS 140 (hope I remembered the course number right) where you write an operating system mostly from scratch is notoriously time consuming and rewarding, at least back when I was there.

Edit: http://www.scs.stanford.edu/20wi-cs140/notes/

Re: Stanford CS248: Implement an SVG Rasterizer

#54

This is a good example of a CS project you would do at Stanford and wouldn't get assigned at your local university.

I talk to people who think a CS degree has the same content and the same level of rigour and challenge everywhere. Absolutely baffles me.

Is that true for literally any degree from a top 5 university?

Re: Stanford CS248: Implement an SVG Rasterizer

#55

This is a good example of a CS project you would do at Stanford and wouldn't get assigned at your local university.

No. We implemented a 3d software frame buffer pipeline at my non-Standford, non-"elite" computer science school, in C and with no dependencies other than the standard library, for our computer graphics class.

Re: Stanford CS248: Implement an SVG Rasterizer

#56
post #55

This is a good example of a CS project you would do at Stanford and wouldn't get assigned at your local university.

No. We implemented a 3d software frame buffer pipeline at my non-Standford, non-"elite" computer science school, in C and with no dependencies other than the standard library, for our computer graphics class.

Well, that is a good example of an assignment you'd do at your local university and wouldn't get assigned at Stanford.

Re: Stanford CS248: Implement an SVG Rasterizer

#57

2d graphics are kinda hard. The problem is that gpus don't support them out of the box so you have to do a Lot yourself.

What do you mean GPUs don't support them? Most opengl tutorials I've read have people building triangles in 2d to learn fragment shaders and vertices before going 3d. Most of them also support parametric curves, so even hardware accelerated bezier curves should be possible.

The first triangle is still in 3d space but the z coordinates are set to 0

Re: Stanford CS248: Implement an SVG Rasterizer

#59

2d graphics are kinda hard. The problem is that gpus don't support them out of the box so you have to do a Lot yourself.

I assume the point is that you have to implement a pure software rasterizer. It's not actually that difficult, but it feels like a lot for an undergrad who's not familiar with the space. I assume this is done as part of a class that gives you context. For an example of a rasterizer, you can take a look at my pure JS implementation of canvas (which is roughly the same imaging model as SVG). All lines and shapes are fl…

Making a 2D rasterizer is fairly trivial, making a rasterizer that looks good is insanely difficult. Handling things like aliasing without overblowing and making it work in all possible cases is tricky and one spends 99% of time addressing those tiny little details that "make one fall in love with software".

Re: Stanford CS248: Implement an SVG Rasterizer

#60
post #6

Earlier quoted context omitted.

It's get somewhat tricky when you want things like gpu support, text rendering etc. You have to do things like stencil texture to speed things up etc etc.

GPUs aren't really designed for 2D graphics out of the box. I've written about this before [0]. Text rendering can be tricky, but not that much trickier -- it's just the same curves at smaller scales. Not sure what you mean by stencil textures. Are you talking about the NV_path_rendering approach where you stencil out the path? Yeah, that's not really a thing that people do these days. [0] https://blog.mecheye.net/20…

> it's just the same curves at smaller scales.

It's not that simple unfortunately. Hinting for TrueType fonts is a thing and without properly aligning resulting pixels at their own scale fonts tend to look very ugly when following pure curve definitions. Oversampling at e.g. 8x size is one possible option but then there are other problems that pop up once downscaling to display size.

Post reply on HN