Coder Social home page Coder Social logo

haskellraytracer's People

Contributors

bkach avatar rumblesan avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

rumblesan

haskellraytracer's Issues

Error while running raycaster

Preprocessing executable 'raycaster' for raycaster-0.1.0.0...
[10 of 10] Compiling Main             ( src/Main.hs, dist/build/raycaster/raycaster-tmp/Main.o )

src/Main.hs:106:21: parse error on input ‘=’

@rumblesan, I will look into this later

Point or Vector?

We're representing points and vectors in the same exact way - would it be advantageous to define them separately? Should we just have point as an alias to a vector?

Better shadow implementation

output

On this branch i've implemented shadows. It's somewhat naive as it checks whether at each point of intersection, the ray from that point to the center of the light does not intersect with any other object.

If the ray is obstructed, the light is simply removed from the list of lights considered for lambert shading. I'm wondering if this approach has any repercussions - would we still need that light information?

And here's the code in question

Plane Cutoff

Why do the planes cut off after a certain point?

output

output

It seems to happen when the lambert value becomes 0. Could this have something to do with not allowing intersections behind a ray?

Basically minIntersections is returning Nothing when it shouldn't be.

Ideas for tests

So we're gonna need unit tests to test the overall functionalities, but i was just thinking of some ways to test the whole pipeline via an image.

No idea how to do that (outside the code i mean) but here's just some ideas

output0
output1
output2
output3

Y coordinates upside down

One important thing to note (confused me a lot).

The image is actually upside down: y is -y.

(u,v) coordinates start on the bottom left, while screen coordinates start at top left!

Double to Word8 Conversion?

It seems like we have to have some arithmetic with our colors - and i'd rather have colors, points, and vectors all use the same three double representation.

How can we cast Doubles to Word8? Doubles take up Word64 amount of space - but since we know they only go from 0 - 255, casting it to an unsigned Word8 shouldn't be an issue... I just have no idea where to begin!

Image library recomendation

Spoke to a knowledgable friend of mine today, and he recommended looking at this as a good image library to use

http://hackage.haskell.org/package/JuicyPixels-3.2.7

specifically the generateImage function here
http://hackage.haskell.org/package/JuicyPixels-3.2.7/docs/Codec-Picture.html

Essentially you just give it a function Int -> Int -> Colour, tell it the x and y widths, and it does the iteration and memory management of canvases. Much simpler and more efficient that dealing with list monads heh

Lambert Shading Cutoff

While creating shadows, if point goes above the lights, it is not shown:

output

What could be obstructing the camera?!

PRs? No PRs?

What's the policy here? No preference, just want to know if we should have some ground rules.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.