|
|
help: reflection shader
#207140
05/17/08 22:55
05/17/08 22:55
|
Joined: Jul 2004
Posts: 1,710
MMike
OP
Serious User
|
OP
Serious User
Joined: Jul 2004
Posts: 1,710
|
hello. Wondering why there is no list of all the shaders here on the forum, that would save new posts. The wiki maybe has not every. 1- My question is: Where i get the shader effect for cube environment reflection... But one, that plane faces of the cube reflection are correctly displayed, like a mirror, since i worked with some where plane faces would not reflect correctly, since in just one face model (ex: cube) (1 face 4 vertices) the reflection is wrong... 2- And for dinamic reflection.. is that hard one to get? I remember there are old games that had it already, so, maybe its not a difficult thing or is it? Pictures show that in some areas the shader is shrinked, and with simple faces, the (planar faces) bottom of the ship, the reflection is just one color, ( when it should reflect the environemnt cube)... Any Idea? Thanks!
Last edited by MMike; 05/17/08 23:12.
|
|
|
Re: help: Cube reflection shader
[Re: Scorpion]
#207244
05/18/08 17:30
05/18/08 17:30
|
Joined: Jul 2004
Posts: 1,710
MMike
OP
Serious User
|
OP
Serious User
Joined: Jul 2004
Posts: 1,710
|
Yes it looks wrong. I did in studio max. But what you mean is that i should not use smoothing group?
I tried with sharp edge and soft edge, and stills not a accurate reflection.
if i asign tha to a plane.. the reflection will catch the whole cubemap, and that can't happen, it should just show the view vector for that region.. O tryed with other environment shader from nvidea and it my model works the way i want to be reflecting.
-- And realtime is with render to texture correct?
Last edited by MMike; 05/18/08 19:39.
|
|
|
Re: help: Cube reflection shader
[Re: Joey]
#207265
05/18/08 20:16
05/18/08 20:16
|
Joined: Jul 2004
Posts: 1,710
MMike
OP
Serious User
|
OP
Serious User
Joined: Jul 2004
Posts: 1,710
|
ok so , how do i get a realist reflecting like those i see on shadercomposer or rendermonkey or etc.. or other games? realtime is not necessary right now.. maybe later. I just need a way to make a simple plane, reflect the word cubemap in a correct maner. like this!: This is done with an environment map. The environment map is a texture resource which is accessed in the fragment program with a reflection vector to retrieve the reflected color. The incident vector is calculated by subtracting the fragments position from the eye position in world space. This vector is then normalized. The objects normal is then rotated into world space and normalized. The reflection vector is calculated using the reflect() standard library function with the incident and normal vector as arguments. IMAGE
Last edited by MMike; 05/18/08 20:23.
|
|
|
Re: help: Cube reflection shader
[Re: MMike]
#207305
05/19/08 03:23
05/19/08 03:23
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
Use a cubemap as a material skin, amking sure you convert it to a cubemap:
bmap_to_cubemap()
Then reflect the eye direction to the current pixel off of the normal
Then use tex3D() to do a texture lookup from a cubemap using the reflection vector.
Adding realtime support does not affect the shader, it's simply a matter of rendering the views of the visible sides of the cubemap.
xXxGuitar511 - Programmer
|
|
|
Re: help: Cube reflection shader
[Re: MMike]
#207416
05/19/08 14:33
05/19/08 14:33
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
tex3D is correct if your sampling from a cubemap...
tex2Dproj if your reading from one flat surface (also plausible for reflection)
xXxGuitar511 - Programmer
|
|
|
|