Live data from Hacker News

Shan, Shui: Procedurally generated Chinese landscape painting

github.com

31–40 of 40 posts

Re: Shan, Shui: Procedurally generated Chinese landscape painting

#31

Nice project. It is strange that all the code is in index.html. I was expecting something like mountains.js, trees.js ... It is also strange to see power towers in the drawings. Why did you add them? (I guess there s an interesting story in this detail.)

> It is strange that all the code is in index.html. I was expecting something like mountains.js, trees.js ...

Why? It's about 4000 lines of JavaScript, which is manageable usable in any editor, and it makes it completely self contained. What would be gained by splitting it up into multiple files?

Re: Shan, Shui: Procedurally generated Chinese landscape painting

#32

Nice project. It is strange that all the code is in index.html. I was expecting something like mountains.js, trees.js ... It is also strange to see power towers in the drawings. Why did you add them? (I guess there s an interesting story in this detail.)

> It is strange that all the code is in index.html. I was expecting something like mountains.js, trees.js ... Why? It's about 4000 lines of JavaScript, which is manageable usable in any editor, and it makes it completely self contained. What would be gained by splitting it up into multiple files?

Readability, separation of concerns, extensibility, easier merging of pull requests, improved testability, modularity, and less mixing of html and Javascript in a single file.

Re: Shan, Shui: Procedurally generated Chinese landscape painting

#34

Earlier quoted context omitted.

yhea i was also interested to sea how he did the outlining effect. I made something tile this once in OpenGL. But that took a lot of code to create. So yhea magic code with many magic numbers.

I've been trying to understand how it works, it looks like a lot of the math deals more with rotation and scaling. It appears there is a function for every object variation, and it looks like each one sets its own color, so I think you could change the colors of individual objects to see what they actually render. The object placement is too perfect, I'm betting the individual objects have a number of predefined plac…

> The object placement is too perfect

Does not seem too perfect to me. I frequently came across the tiny trees placed in the water near the shore and also on the rock formations, something I have yet to have seen in the real world.

Re: Shan, Shui: Procedurally generated Chinese landscape painting

#35
post #32

Earlier quoted context omitted.

> It is strange that all the code is in index.html. I was expecting something like mountains.js, trees.js ... Why? It's about 4000 lines of JavaScript, which is manageable usable in any editor, and it makes it completely self contained. What would be gained by splitting it up into multiple files?

Readability, separation of concerns, extensibility, easier merging of pull requests, improved testability, modularity, and less mixing of html and Javascript in a single file.

All of these are often of little concern to artists, who prefer to get in the flow of actually getting stuff done. Organizing your project is fun and all, but there's A TON value in eliminating context switches and shortening your iteration loop. Source: I participate in game jams.

Obviously, it would be nice to follow this up with refactoring, but you could also spend this time on another project, of which the author has many (and likely thanks to this "fire and forget" attitude).

Re: Shan, Shui: Procedurally generated Chinese landscape painting

#36

Earlier quoted context omitted.

I've been trying to understand how it works, it looks like a lot of the math deals more with rotation and scaling. It appears there is a function for every object variation, and it looks like each one sets its own color, so I think you could change the colors of individual objects to see what they actually render. The object placement is too perfect, I'm betting the individual objects have a number of predefined plac…

> The object placement is too perfect Does not seem too perfect to me. I frequently came across the tiny trees placed in the water near the shore and also on the rock formations, something I have yet to have seen in the real world.

It’s actually very common - trees will take root in the slightest crack or depression, can even cause large boulders to split over over time. Load up duck duck go and do an image search for “trees in rocks” and there are plenty of examples.

Re: Shan, Shui: Procedurally generated Chinese landscape painting

#37
post #32

Earlier quoted context omitted.

> It is strange that all the code is in index.html. I was expecting something like mountains.js, trees.js ... Why? It's about 4000 lines of JavaScript, which is manageable usable in any editor, and it makes it completely self contained. What would be gained by splitting it up into multiple files?

Readability, separation of concerns, extensibility, easier merging of pull requests, improved testability, modularity, and less mixing of html and Javascript in a single file.

I'm sorry, but it's not obvious to me how splitting the code into more files gives you any of these things except less mixing of HTML and JavaScript (which doesn't seem like a problem unless you have tools that won't handle it). Aren't these aspects of the code itself?

Re: Shan, Shui: Procedurally generated Chinese landscape painting

#39

Earlier quoted context omitted.

I think this is true for (at least) one reason: robots can iterate a lot faster. Content generation is a human bottleneck.

[prediction] As robots improve to produce better and more art, the value of authentic human art will rise. It will not matter if you can't tell the difference. The knowledge that a human produced it will be enough.

That's a curious thought. I would actually go the other way. Imagine if some AI art systems were truly better than others, and became exclusive? How fun!

Re: Shan, Shui: Procedurally generated Chinese landscape painting

#40
post #6
post #3

The author has a lot of interesting projects on his page: https://lingdong.works/ though I haven't checked all of them out (I have no desire to watch anyone's face decay). As a geologist, I happen to think that all landscapes are procedurally generated, though it is in general a slower generation process than the computer simulations. Nonetheless I remain fascinated by both the Earth and computational representations…

Thank you for posting this. I might not have discovered his other works page without your comment. One odd thing happened as I was trying to see the software in action. When I clicked on the link to show the software in action https://lingdong-.github.io/shan-shui-inf/ I got a security warning from Firefox. The alternative link https://shan-shui-inf.glitch.me/ did not produce an error. I don't know why.

Firefox tells me:

  Web sites prove their identity via certificates. Firefox does not trust this site because it
  uses a certificate that is not valid for lingdong-.github.io. The certificate is only valid for
  the following names: www.github.com, *.github.com, github.com, *.github.io, github.io,
  *.githubusercontent.com, githubusercontent.com

  Error code: SSL_ERROR_BAD_CERT_DOMAIN
So it seems it thinks that *.github.io does not match lingdong-.github.io. Perhaps due to the trailing hyphen?
Post reply on HN