|
-
Dec 14th, 2020, 05:58 AM
#1
RAYMARCHING HLSL/GLSL (DX/OpenGL)
Hello
I want to open this thread because I am very interested in this topic.
Probably, however, as often happens to me I will not find interested people, but I try anyway.
preamble.
Some time ago I came across a rendering technique called RayMarching. In my opinion it is the most interesting that exists. Because it allows you to achieve superb effects and quality without having to deal with Meshes.
It consists in having as input the screen pixel coordinates (UV) normalized in the range (-1 to 1, -1 to 1).
For each coordinate a Ray is started from the observation point to it (screen pixel).
Using this Ray we measure the distance from the objects we want to represent using the SDF technique.
Once the distance has been obtained, the normal of the encountered surface is calculated.
This normal (together with that of the direction of a light source) is used to calculate the diffusion and refraction of light.
In addition, the shadow can also be calculated.
All this if you intend to create a "realistic" rendering, but there is also the possibility of creating "abstract" outputs.
Here you can see an exhaustive and better explanation of the above.
And here is something I created with pure VB6
https://www.youtube.com/watch?v=QVZIy8wXVSM
https://www.youtube.com/watch?v=OFuEnjrSQiM
OK, all great, but then what's the problem?
Well, it took a lot of processing time to get these animations. (many seconds per frames)
For each pixel the amount of calculations to be carried out is truly remarkable and performing this with VB6 is an infinite slowness.
But here it comes wqweto that pleased us with a Type Library for DirectX 11.
Exploring a bit of the examples provided in wqweto library we can find the HLSL Code.
https://en.wikipedia.org/wiki/Cg_(programming_language)
This DX-compiled and executed code is surely supersonic when compared to VB6.
I am sure it is possible to realize RayMarching using the HLSL code. (integrated via wqweto library with VB6)
And not taking advantage of this opportunity would be a mortal sin.
What we need is someone quite knowledgeable about VertexShader and FragmentShader (PixelShader)
That is all for the moment.
v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v
EDIT 29/12/2020
Progress has been made.
In this starter post I will keep the main content list updated.
- DX11 Shader (No variables) by Me
- TrueVision3D Shader (Initial example) by Me
- DX9 Shader (WITH 1 Variable) by TheTrick
- DX9 Shader (WITH 1 Variable) by Me
- TrueVision3D Shader 2 (second example with FLOAT3) by Me
- DX9 Shader (more than 1 Variable) by TheTrick
The ones made by me are downloadable all at once here
Last edited by reexre; Jan 22nd, 2021 at 06:10 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|