Compare commits
2 Commits
c2d230bed0
...
d94aac009c
Author | SHA1 | Date | |
---|---|---|---|
d94aac009c | |||
e18b2ba7e5 |
28
README.md
Normal file
28
README.md
Normal file
@ -0,0 +1,28 @@
|
||||
# raytracing
|
||||
|
||||
Based on the series <a href="https://raytracing.github.io"><cite>Ray Tracing in One Weekend</cite></a>.
|
||||
|
||||
## Scenes
|
||||
|
||||
### squares
|
||||

|
||||
|
||||
```
|
||||
java -jar raytracing.jar --samples 500 --height 1200 SQUARES
|
||||
```
|
||||
|
||||
### cornell box
|
||||
|
||||

|
||||
|
||||
```
|
||||
java -jar raytracing.jar --samples 50000 --height 1200 CORNELL
|
||||
```
|
||||
|
||||
### cornell box with smoke
|
||||
|
||||

|
||||
|
||||
```
|
||||
java -jar raytracing.jar --samples 50000 --height 600 CORNELL_SMOKE
|
||||
```
|
BIN
docs/cornell_smoke.png
Normal file
BIN
docs/cornell_smoke.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 346 KiB |
BIN
docs/squares.png
Normal file
BIN
docs/squares.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 702 KiB |
@ -41,6 +41,7 @@ public enum ImageFormat {
|
||||
private static final int IHDR_TYPE = 0x49484452;
|
||||
private static final int IDAT_TYPE = 0x49444154;
|
||||
private static final int IEND_TYPE = 0x49454E44;
|
||||
private static final int IEND_CRC = -1371381630;
|
||||
|
||||
@Override
|
||||
public void write(@NotNull Canvas image, @NotNull OutputStream out) throws IOException {
|
||||
@ -101,7 +102,7 @@ public enum ImageFormat {
|
||||
private void writeIEND(@NotNull Canvas image, @NotNull DataOutputStream data) throws IOException {
|
||||
data.writeInt(0);
|
||||
data.writeInt(IEND_TYPE);
|
||||
data.writeInt(0);
|
||||
data.writeInt(IEND_CRC);
|
||||
}
|
||||
|
||||
private static class NoCloseDataOutputStream extends DataOutputStream {
|
||||
|
Loading…
x
Reference in New Issue
Block a user