» HLSL shader question: projecting flat texture on mesh if it would be a 2d image
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

HLSL shader question: projecting flat texture on mesh if it would be a 2d image

question resolved using-vvvv hlsl texture

cybear 10/02/12 - 06:39

Hello to all!

I have a question regarding the HLSL language.

How do I project a texture on a Mesh treating as it would be a flat 2d image
instead of projecting it around the geometry?

I tried changing the Out.TexCd in the vertex shader and also the
tex2D in the pixelshader, but I didn't find out how to do it.

Anyone has a hint?

Thanks in advance :)

9 replies 0 new

The mesh should be like a mask where the texture is only visible where alpha is not zero.

i used to change UV mapping of the geometry (according point of view), maybe there is HLSL way to get the same.

I'm sure that it must be really simple. Unfortunately I'm really a beginner with hlsl...

Hey,

this is another approach to it, without hlsl though.
in case you're in a hurry.

gradient-from-dynamic-texture-to-draw-fixed

link | Flagged as solution by cybear. Remove solution flag. tonfilm (devvvv) 10/02/2012 - 23:35

tex2Dproj is the one you are looking for:

Thanks tonfilm. that's it.
default shader mode: mirror - would be great to get border mode option as well

link | Flagged as solution by cybear. Remove solution flag. cybear 11/02/2012 - 18:33

Thank you tonfilm! That's it what I was searching! :)

link | Flag this reply as a solution. tonfilm (devvvv) 12/02/2012 - 15:50

the texture sampler modes can be set with something like:

sampler Samp = sampler_state    //sampler for doing the texture-lookup
{
    Texture   = (Tex);          //apply a texture to the sampler
    MipFilter = LINEAR;         //sampler states
    MinFilter = LINEAR;
    MagFilter = LINEAR;
    AddressU = border; //or mirror, wrap, clamp
    AddressV = border; //or mirror, wrap, clamp
    BorderColor = (someColor);
};

Thanks again, but that I always knew. But perhaps it can be useful for others! :)

anonymous user login

Shoutbox

~2d ago

StiX: see you guys on node, i am trying to get people that use vvvv in cz/sk to come with me

~2d ago

aelfwine: anything have BullEye software?? I don't find the file :( merci

~2d ago

~2d ago

mediadog: @evvvvil you dawwwwg! #1 place I want to go that I haven't been. Enjoy it!

~2d ago

dannielmach: @evvvvil tel whatsapp 55 32 9913 2509

~3d ago

evvvvil: @danielmach: Eu sou "evvvvil" no skype, Qual e seu skype ou email? Nao posso achar no seu vvvv perfil...

~3d ago

evvvvil: @danielmach: Shame Brazil is such a huge country. I might go to Belo Horizonte, if so i'll be in touch :)

~3d ago

evvvvil: @everyoneishappy: Kyle, if you come I will learn juggling and introduce you to my wife's sisters.

~3d ago

dannielmach: I am currently out of money to go matias barbosa mg is 10 km :(

~3d ago

dannielmach: @ evvvil 1073.41 km de juiz de fora mg