Skip to content

Original Picture #14

Answered by rafael-fuente
rudiana587 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello!
If you replace Sc.render() by Sc.get_distances() in any of the examples you'll avoid almost all rendering algorithm and you'll get a greymap where the darker pixels indicates that the object is nearer from the camera.

In example1.py this will be: (I just remplaced line 42)

from sightpy import *

# define materials to use

gold_metal = Glossy(diff_color = rgb(1., .572, .184), n = vec3(0.15+3.58j, 0.4+2.37j, 1.54+1.91j), roughness = 0.0, spec_coeff = 0.2, diff_coeff= 0.8) # n = index of refraction
bluish_metal = Glossy(diff_color = rgb(0.0, 0, 0.1), n = vec3(1.3+1.91j, 1.3+1.91j, 1.4+2.91j), roughness = 0.2,spec_coeff = 0.5, diff_coeff= 0.3)

floor =  Glossy(diff_color = image("check…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rafael-fuente
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #13 on June 09, 2021 16:20.