Jump to content

Camera Projection Problem (tondc)


realer

Recommended Posts

Hello

after searching the forum i came to do this shader.. which should let me select a camera to project from and a map to project..

#pragma hint map image
#pragma hint cam oppath "obj/camera"

surface
GR_camera_projection_map(
string map = "";
string cam = "";
)

{

float uu,vv;
vector pos;

if (map != "")
{
if (cam != "")
{

pos = wo_space(P);

pos = toNDC(cam, pos);


uu = pos.x;
vv = pos.y;


Cf = texture(map, uu,vv);
}

else
{
Cf = {0,1,0};
//Cf = texture(map, uv.x,uv.y); // Debug purposes
}
}

else
{
Cf = {1,0,0};
//Cf = texture(map, uv.x,uv.y); // Debug purposes
}
}

now when i compile this in H9 0 720 i get no interface at all, bracing error and it simply does not work... what am i doing wrong?? light projection would work i know but i want it this way. also i need projection since uv-mapping creates awefull distortions and even more i want to understand vex shader programming ;

Link to comment
Share on other sites

Hello

after searching the forum i came to do this shader.. which should let me select a camera to project from and a map to project..

now when i compile this in H9 0 720 i get no interface at all, bracing error and it simply does not work... what am i doing wrong?? light projection would work i know but i want it this way. also i need projection since uv-mapping creates awefull distortions and even more i want to understand vex shader programming ;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...