ClementCariou / virtual-art-gallery

Explore an Art Gallery in your browser.
https://clementcariou.github.io/virtual-art-gallery/build
MIT License
202 stars 84 forks source link

How to change the colour of the walls and floor on mesh.js #10

Closed maielamin closed 3 years ago

ClementCariou commented 3 years ago

Yes, you will have to modify the fragment shader in mesh.js.

maielamin commented 3 years ago

I figured out how to do this but it does involve a couple steps. In the mesh.js folder I commented Line 96: totalLight = pow(totalLight, vec3(1.0/2.2)); Copied and pasted Line 96: totalLight = pow(totalLight, vec3(,,); (deleting what was inside the brackets of vec3. In these brackets you have to add a GSL vec 3 code which consists of 3 digits. Using coolors.co to look up hex codes for a colour, I then converted them into GSL vec 3 using this website https://airtightinteractive.com/util/hex-to-glsl/. Copying and pasting the code into the brackets.

*When looking for a colour, find the complimentary colour on a colour wheel and look for that hex code. For example, Dark purple #2B061E will give you a green coloured room (as shown in the picture below). warm-cool-colors

Dark purple #2B061E