Search found 4 matches

by ogge
Tue Jan 18, 2022 7:46 pm
Forum: Games and Creations
Topic: a simple raycaster with floor and ceiling
Replies: 0
Views: 10372

a simple raycaster with floor and ceiling

a simple raycaster with floor and ceiling
by ogge
Sun Jan 16, 2022 3:53 pm
Forum: Support and Development
Topic: Sending 1D depthbuffer to a shader
Replies: 4
Views: 3436

Re: Sending 1D depthbuffer to a shader

Make an ImageData of format r32f (or whatever fits best) with the approriate width and a height of 1 pixel. Make an Image from the ImageData, that's your texture, and send it to the shader. Use Image:replacePixels to update the texture. Use ImageData:mapPixel to update the pixels, avoid ImageData:s...
by ogge
Sun Jan 16, 2022 9:42 am
Forum: Support and Development
Topic: Sending 1D depthbuffer to a shader
Replies: 4
Views: 3436

Re: Sending 1D depthbuffer to a shader

Nelvin wrote: Sun Jan 16, 2022 8:38 am You could use a texture, store your distances in it's pixels and then sample the value using your x-coordinate in your shader.
but won't that limit me to store a maximum of 255*4 different values per pixel?
by ogge
Sat Jan 15, 2022 11:22 pm
Forum: Support and Development
Topic: Sending 1D depthbuffer to a shader
Replies: 4
Views: 3436

Sending 1D depthbuffer to a shader

Hello, is there a way for me to send a 1D depth-buffer to a shader. I'm trying to store a value(distance) for every x-coordinate on the screen. And I would like to send it to my shader. I've tried to send an array to the shader, but that won't let me send over 1019 values to a shader. Plus I heard t...