Historique des modifications - Message

Message #4410

Sujet: Bulle d'eau


Type Date Auteur Contenu
Création du message 16-07-2008 12:16:32 Chris
Bon, après avoir fouillé un peu sur le forum de Irrlicht. J'ai trouvé le tutoriel sur la réfraction de "blindside" (http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=27054)

Ca correspond exactement à ce a quoi je souhaité arriver mais j'ai un autre problème.
Le shader est écrit en GLSL (opengl) et je travaille avec dx9.
Est ce que quelqu'un pourrait faire la conversion glsl --> hlsl pour moi ? Je n'y arriverai pas personnellement et j'en ai terriblement besoin.
Voici le code des vertex et pixel shader qui m'interresse.
Je remercie 1000 fois par avance celui qui pourra me réaliser cette traduction. smile

uniform sampler2D RTTexture;
uniform sampler2D NormalMap;
uniform vec4 TintColour;

varying vec4 GlassPos;
varying vec2 TexCoord;
varying float VAlpha;

void main()
{
    vec4 projCoord = GlassPos / GlassPos.w;
    projCoord += vec4(1.0);
    projCoord *= 0.5;
    vec2 norTex = TexCoord.xy;

	vec4 NorMap = texture2D(NormalMap,norTex);
    vec3 Normal = NorMap.xyz;
    
    vec2 TexOff = Normal.xy * 2.0;
    TexOff -= vec2(1.0,1.0); 
    
    projCoord.xy += ((TexOff.xy - vec2(0.5,0.5)) / 25.0);
    projCoord.xy = clamp(projCoord.xy, 0.001, 0.999);
    
    vec4 refTex = texture2D(RTTexture,projCoord.xy);
    
    gl_FragColor = refTex * TintColour;
    gl_FragColor.a = NorMap.a * VAlpha;
}

uniform mat4 mWorld;
uniform vec4 CamPos;
uniform float TexMul, AlphaAdjust;
varying vec4 GlassPos;
varying vec2 TexCoord;
varying float VAlpha;

void main()
{
	VAlpha = gl_Color.a * AlphaAdjust;

    TexCoord = gl_MultiTexCoord0.xy;
    GlassPos = ftransform();
	
    gl_Position = GlassPos;
}

Retour

Options Liens officiels Caractéristiques Statistiques Communauté
Préférences cookies
Corrections
irrlicht
irrklang
irredit
irrxml
Propulsé par Django
xhtml 1.0
css 2.1
884 membres
1440 sujets
11337 messages
Dernier membre inscrit: Saidov17
189 invités en ligne
membre en ligne: -
RSS Feed