| Re: is it possible to access vertex information from within a pixel shader? |
|
 |
|
 |
|
 |
|
 |
Group: microsoft.public.win32.programmer.directx.graphics · Group Profile
Author: Jan BrunsJan Bruns Date: Feb 16, 2007 17:29
"Jan Bruns":
> [per vertex floats in pixel shader]
> Two of which may be used to encode the triangle-uv-interpolator,
A simple
float2 interpolated; // values at triangle vertices: (0,0),(0,1),(1,0)
should do: solve
interpolated.xy = P1 + u*(P2-P1) + v*(P3-P2)
P1 = (0,0)
P2 = (0,1)
P3 = (1,0)
for (u,v).
> or with the benefit reluting in a 2:1 instead of 3:1 packing.
Nonesense. Sorry. I was mixing up thoughts about per object data
with thoughts about per vertex data:
> This is relevant for some raytracing techniques, rendering non
> polygon-based geometry (the polygon-based part can then be used to draw
> a bounding box of the object, to avoid unnecessary frame+Zbuffer bandwidth
> consumption).
Not 100%% correct in this context. Or a bit misleading:
If this per object data is passed somewhere, it doesn't need to be per vertex.
Gruss
Jan Bruns
|