[SoC] Blender GlSl project - GraphicAll.org
GraphicAll.org
Paste Code
Paste Blends
Paste Images

    [SoC] Blender GlSl project
    Builderlguillaume
    OS
    DateAug-28-07
    TypeSoC

    Description

    New build, there si many things to says : metaball, curve surface, colorband, ...

    For moment texture doesn't works.

     

    For Linux build click here

     

    update 07/07/02:

    Added spot light and area light

     

    update 07/07/05:

    removed int variables and preprocessor concatenation symbol for ATI cards

    Please yser with Ati card, says if blender fails

     

    update 07/07/07:

    Glsl colorband blending functions

    I put only the executable, the shader and glew32.dll in the archive, you need to copy in your official blender directory.

    update 07/07/13:

    Material structures creation refactor for better error detection

    +Defmaterial now works
    +Created colorband changes events
    +Created colorband parallel structure and function prototypes

    update 07/07/17:

    Colorband texture creation and uniform sending

    GLSL code correction for colorbands

    Duplicate lights fix

    update 07/07/31:

    Many works on colorband

    update 07/07/31:

    Metaball and curve (there is few problems with curve and surface) works with glsl

     



    DownloadBuild!!



    Blender Foundation's Chaos and Evolution Training DVD by David Revoy

    Comments
    mike
    awesome, but it might be helpful if you told people how to enable it :D

    http://mpan3.homeip.net/f/glsl.jpg

    this is how i did it.
    Falgor
    Thanks mpan for showing the rest of us.
    Jedrzej_s
    Hi Guys !

    I can't enabled GlSl :(. I have ATI Radeon 9600 PRO (it supported OpenGL 2.0). Here is screenshot: http://img406.imageshack.us/my.php?image=blenderglslerrorwu5.png
    jaha
    Hi! I have Radeon 9600PRO and I have same problem as you. Thats strange, because this card have glsl support.
    Miguel Torres Lima
    You're right it must have glsl support or otherwise the button wouldn't even appear and it would use blender's drawing code. Sometimes the compiling errors are outputted in the text window, along with the shader code and many other things just for me to know what is happening rather painlessly, sometimes it is printed the compiling errors the driver outputs. I would be very grateful if you would send that part of the output in the text window to torreslima at gmail dot com.

    Many thanks.
    Miguel Torres Lima
    Forgot to mention: I ask you for this because I don't have an ATI card.
    FabioLeRoy
    Hi ALL,

    I has the same problem of Jedrzej_s and jaha with my Ati X600. The issue occurs when I set a new material to a mesh.
    Below the output of the console (in Windows XP):

    GLSL Material created.

    GLSL DefMaterial created.
    Compiled with Python version 2.5.
    'import site' failed; use -v for traceback
    Checking for installed Python... No installed Python found.
    Only built-in modules are available. Some scripts may not run.
    Continuing happily.

    GLSL Supported

    GLSL MaterialTree removed.

    GLSL Light created.

    GLSL Material created.

    GLSL DefMaterial created.

    GLSL Material created.

    GLSL Program created.

    GLSL Shader code writing...
    Memoryblock GLSL Node Code: end corrupt

    Code:
    struct light{
    vec3 loc;
    vec3 vec;
    vec3 color;
    float dist;
    float energy;
    float att1;
    float att2;
    float att3;
    float att4;
    float gamma;
    float area_x;
    float area_y;
    int sphere;
    int square;
    int area_type;
    int layer;
    mat4 mat;
    };
    varying vec3 vert_color;
    varying vec3 normal, pos;
    varying vec4 realcolor;
    uniform vec3 eye;
    uniform vec3 amb_color;
    uniform float amb_exp, amb_range;uniform vec3 u_mat_0_diff_color;
    uniform vec3 u_mat_0_spec_color;
    uniform vec3 u_mat_0_normal;
    uniform float u_mat_0_alpha;
    uniform float u_mat_0_diff1;
    uniform float u_mat_0_diff2;
    uniform float u_mat_0_diff3;
    uniform float u_mat_0_spec1;
    uniform float u_mat_0_spec2;
    uniform float u_mat_0_spec3;
    uniform float u_mat_0_amb_fac;
    uniform float u_mat_0_emit;
    uniform int u_mat_0_hard;
    uniform light lights[2];
    vec3 lambertdef(light l, vec3 vnormal, vec3 diff_color, float ref, float unused1
    , float unused2){
    vec3 lightVec = normalize(l.loc - pos);
    return(max(dot(lightVec, vnormal) * ref * vec3(l.color + vert_color) * d
    iff_color, 0.0));
    }
    vec3 lambertsun(light l, vec3 vnormal, vec3 diff_color, float ref, float unused1
    , float unused2){
    vec3 lightVec = normalize(l.vec);
    return(max(dot(lightVec, vnormal) * ref * vec3(l.color + vert_color) * d
    iff_color, 0.0));
    }vec3 lamberthemi(light l, vec3 vnormal, vec3 diff_color, float ref){
    vec3 lightVec = normalize(l.vec);
    return((0.5 * dot(lightVec, vnormal) + 0.5) * ref * vec3(l.color + vert_
    color) * diff_color);
    }vec3 cooktorrdef(light l, vec3 vnormal, vec3 spec_color, float spec, float hard
    , float unused){
    vec3 view = normalize(eye - pos);
    vec3 h = normalize((eye - pos) + (l.loc - pos));
    float nh = max(dot(vnormal, h), 0.0);
    float nv = max(dot(vnormal, view), 0.0);
    return((spec * pow(nh, hard) * spec_color / (0.1 + nv)) * vec3(l.color +
    vert_color));
    }
    vec3 cooktorrsun(light l, vec3 vnormal, vec3 spec_color, float spec, float hard,
    float unused){
    vec3 view = normalize(eye - pos);
    vec3 h = normalize((eye - pos) + l.vec);
    float nh = max(dot(vnormal, h), 0.0);
    float nv = max(dot(vnormal, view), 0.0);
    return(spec * pow(nh, hard) * vec3(l.color + vert_color) * spec_color /
    (0.1 + nv));
    }
    vec3 cooktorrhemi(light l, vec3 vnormal, vec3 spec_color, float spec, float hard
    ){
    vec3 view = normalize(eye - pos);
    vec3 h = normalize((eye - pos) + l.vec);
    float nh = 0.5 * (max(dot(vnormal, h), 0.0)) + 0.5;
    return(spec * nh * pow(nh, hard) * vec3(l.color + vert_color) * spec_col
    or);
    }
    float visibility_lamp(light l){
    float visifac = 1.0;
    vec3 lv = (pos - l.loc);
    float dist = sqrt(dot(lv, lv));
    visifac = l.dist / (l.dist + (l.att1 * dist));
    visifac *= (l.dist * l.dist) / ( l.dist * l.dist + (l.att2 * dist * dist
    ));
    visifac = max(visifac * l.att3, l.dist / (l.dist + dist) * l.att4);
    float m = max(l.dist - dist, 0.0);
    return(visifac * max(m / l.dist, l.sphere));
    }

    #define MATERIAL_ID 0

    #define MATERIAL_FUNC material_ ## 0
    vec3 MATERIAL_FUNC(inout vec3 diff_color, inout vec3 spec_color, inout vec3 norm
    al, inout float alpha, float diff1, float diff2, float diff3, float spec1, float
    spec2, float spec3, float amb_fac, float emit, int hard){
    vec3 diff_rslt = vec3(0.0, 0.0, 0.0);
    vec3 spec_rslt = vec3(0.0, 0.0, 0.0);
    vec3 amb_rslt = amb_color * amb_fac;
    float vis = 0.0;

    #define LIGHT_CALCULATIONS 1

    #define LIGHT_ID 0

    #define VISIBILITY visibility_ ## lamp

    #define CALC_DIFFUSE 1

    #define DIFF_SHADER_ID lambert ## def

    #define CALC_SPECULAR 1

    #define SPEC_SHADER_ID cooktorr ## def
    #ifdef LIGHT_ID
    vis = VISIBILITY(lights[LIGHT_ID]);
    #endif

    #ifdef CALC_DIFFUSE
    #ifdef LIGHT_ID
    #ifdef HEMI
    diff_rslt+= amb_exp * (1.0 - exp(DIFF_SHADER_ID(lights[LIGHT_ID], normal, diff_c
    olor, diff1) * lights[LIGHT_ID].layer * lights[LIGHT_ID].energy * vis * amb_rang
    e));
    #else
    diff_rslt+= DIFF_SHADER_ID(lights[LIGHT_ID], normal, diff_color, diff1, diff2, d
    iff3) * lights[LIGHT_ID].layer * lights[LIGHT_ID].energy * vis;
    #endif
    #endif
    #endif

    #ifdef CALC_SPECULAR
    #ifdef LIGHT_ID
    #ifdef HEMI
    spec_rslt+= SPEC_SHADER_ID(lights[LIGHT_ID], normal, spec_color, spec1, hard) *
    lights[LIGHT_ID].layer * lights[LIGHT_ID].energy * vis;
    #else
    spec_rslt+= SPEC_SHADER_ID(lights[LIGHT_ID], normal, spec_color, spec1, spec2, s
    pec3) * lights[LIGHT_ID].layer * lights[LIGHT_ID].energy * vis;
    #endif
    #endif
    #endif

    #undef VISIBILITY
    #undef LIGHT_ID
    #undef CALC_DIFFUSE
    #undef CALC_SPECULAR
    #undef DIFF_SHADER_ID
    #undef SPEC_SHADER_ID
    #undef HEMI
    #ifdef LIGHT_CALCULATIONS
    return(amb_exp * (1.0 - exp(diff_rslt * amb_range)) + spec_rslt + amb_rslt);
    #else
    return(vec3(0.0, 0.0, 0.0));
    #endif
    }

    #undef MATERIAL_ID
    #undef MATERIAL_FUNC
    void main(void){ vec3 norm = normalize(normal); vec3 diff_color = realcolor.xyz
    ; vec3 spec_color = u_mat_0_spec_color; float alpha = realcolor.a; float diff1 =
    u_mat_0_diff1; float diff2 = u_mat_0_diff2; float diff3 = u_mat_0_diff3; float
    spec1 = u_mat_0_spec1; float spec2 = u_mat_0_spec2; float spec3 = u_mat_0_spec3;
    float amb_fac = u_mat_0_amb_fac; float emit = u_mat_0_emit; int hard = u_mat_0_
    hard; vec3 result = material_0(diff_color, spec_color, norm, alpha, diff1, diff2
    , diff3, spec1, spec2, spec3, amb_fac, emit, hard); gl_FragColor = vec4(result,
    alpha);}

    END OF CODE

    ╚n▄♀på▄♀DATA°

    GLSL Shader Compile Error
    Memoryblock GLSL Node Code: end corrupt

    GLSL Material removed.

    GLSL MaterialTree removed.

    GLSL Light removed.

    GLSL MaterialTree removed.

    GLSL deactivated.

    GLSL MaterialTree created.
    ZanQdo
    Introducing pastebin.ca :)
    EnV
    Mine works (win XP, Nvidia) but setting a new material to a mesh crashes Blender everytime.
    Jose
    error:

    AppName: blender_glsl.exe AppVer: 0.0.0.0 ModName: unknown
    ModVer: 0.0.0.0 Offset: 00000000
    Jose
    error:

    AppName: blender_glsl.exe AppVer: 0.0.0.0 ModName: unknown
    ModVer: 0.0.0.0 Offset: 00000000
    dreblen
    Hi, if I press the 'GLSL preview' button in the system and openGL section of the user prefs, it pops up a dialog titled "GLSL fragment shader compile error:", and the dialog contains one item with the label "GLSL support disabled", anyone know what the problem is?
    ajuss
    Hi,experiment with Jul-5-07 version.
    i start with empty scene (no cameras, lights etc). Activate GLSL preview - it activates, then add sphere, then materila and when i add lights blender disables GLSL preview,
    console: GLSL shader compile error
    Memoryblock GLSL Node Code: end corrupt

    I have ATI FreGL 3100 (latest drivers), P4 3,6ghz, 2gRam, WinXPsp2
    JiriH
    Works fine here with nVidia chip. Will there be also texture realtime prewiew enabled (something like texture shading mode combined with shading mode)? That would be really great, I suppose that Blender can handle this somehow as there is preview in texture buttons.
    phexitol
    Same error, ATI Radeon 9800.
    Jens
    Hi iguillaume
    I will try to make an OSXintel Build, where do the f... glew-libs go ?
    Have not found any advice up to now.
    Greetz...Jens

    Jens
    Hi all. Got it. But on OSX it seem rather WIP. Some features work somehow, but
    always "fragmentshader error ( relateted to svn 24.7.07 ). Have to keep an eye on progress. Greetz...Jens
    James
    I have a Nvidia geforce 6200 a-le, which supports Open GL 2.0 and I believe glsl. I don't see the glsl Preview in my list.

    James
    nooblend
    Hi all! Tried to compile the actual svn branch for myself, still end up with a linker prob when linking project blender (using cmake and vc++, see geneome.net). Could someone please give me a hint? Already fixed missing entries in some cmakelist.txt files but when it comes to linking it stops with unresolved symbols in src.lib function _glsl_shader_utils (the extern_glew.lib seems to be build correct). Thanks... nooblend
    nooblend
    Add: Nice to have your fantastic builds! Saw them, tried them, liked them very much and got the idea about compiling blender myself... and now you see what I've got ;-)!
    RNS
    I downloaded the file and open it it won't execute,because
    a glew32.dll is not found? Help!
    RNS
    I downloaded the file and open it it won't execute,because
    a glew32.dll is not found? Help!
    ajuss
    Wow, todays build(Aug-28-07) works with my ATI FireGL 3100 (WinXP, latest catalyst drivers for FireGL).
    blendermf
    it works on my ati radeon x1300 too, its awesome
    Jose
    Ati raendon 9550
    error:
    GLSL error, uniform location not found:u_mat_0_alpha...
    GLSL activated

    =:-)
    David
    Same problem as RNS : glew32.dll not found ( vista 32 / Radeon Xpress 1200 )
    RNS
    It seem that this built only work with High end Card.
    RNS
    It seem that this built only work with High end Card.
    mpan3
    Glew32.dll not found is not an error. Simply install glew32.dll into the blender directory! (google for the file)

    Also, lguillaume, just wanted to let you know that the current build works flawlessly on *ATI* Radeon Xpress x1150 (notebook)
    mpan3
    ...Xpress x1150, on WIndows XP with catalyst 7.8
    RyanBarrett
    I've just tried downloading this build from home and from work and I get CRC errors try to unzip in both places... so... there must be something wrong with the file.
    RyanBarrett
    I've just tried downloading this build from home and from work and I get CRC errors try to unzip in both places... so... there must be something wrong with the file.
    Malacath
    Yeah, I know it has been asked. But Glew32.dll isn't found and i googled it. I found one, but Blender still ctashes. I have a Geforce 8600 GT

    Leave a Comment!


    back to GraphicAll.org