1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice
Like RaceDepartment on Facebook.

NON CG to CG

Discussion in 'Racer Problems & Fixes' started by Panco, Jan 3, 2013.

  1. Hi, i tried to convert rims from NON CG to CG and this happend..
    [​IMG]

    SHADERS:
    shader_rim~vf_standard
    {
    motion_blur=0
    layer0
    {
    map=gradient.tga
    texgen_s=sphere_map
    texgen_t=sphere_map
    emission=1 1 1 1
    }
    layer1
    {
    map=$trackenvmap
    texgen_s=reflection_map
    texgen_t=reflection_map
    texgen_r=reflection_map
    blendfunc=filter
    shininess=24
    specular=0.75 0.75 0.75
    }
    layer2
    {
    map=Rota_Tamarc.tga
    blendfunc=one src_alpha
    }
    }
    shader_tyre1~vf_standard
    {
    motion_blur=0
    layer0
    {
    map=AD08_Sidewall.tga
    }
    }
    shader_tyre2~vf_standard
    {
    motion_blur=0
    layer0
    {
    map=ADVAN.tga
    }
    }
    shader_disc~vf_standard
    {
    motion_blur=0
    layer0
    {
    map=Freio.tga
    }
    }
     
  2. Stereo

    Stereo
    Premium Member

    When using the new shaders, you need the primary texture to be in layer0
    This should also probably be ~vf_reflect since it uses the $trackenvmap.
     
  3. I think i got it, but you writed this shader for me?
    EDIT:
    I tried but now rims are black :( can you rewrite it for me so i can use your e.g
     
  4. KS95

    KS95
    RACER Moderator

    Do you have the shader templates at the top of the car.shd file?

    Like this:
    Code:
    vf_standard
    {
      vertex_shader
      {
        file=dyn_standard_v.cg
      }
      fragment_shader
      {
        file=standard_f.cg
      }
    }
     
    vf_reflect
    {
      vertex_shader
      {
        file=dyn_standard_reflect_v.cg
      }
      fragment_shader
      {
        file=dyn_standard_reflect_f.cg
      }
    }
    
     
  5. Yes i have, why?
     
  6. BUMP, need help fast!
     
  7. Have you blendfunc on your shader?
    Also remove (if you have) ambient/diffuse value, to get a real basic shader
    The code posted by stereo should work
     
  8. Code posted by stereo doesn't work, when i put his code my rims are black... can you rewrite it skybh? PLS, so i can later use your example to learn it!
     
  9. Hum for the rim, if you want it reflect, change vf_standard by vf_reflect
    also it's seems that the rim texture is not correct, what is its size?
     
  10. What do you mean with "What is its size" ?
     
  11. Panco, he mean that you should check the texture image size, i.e. it should be 128x128 or 256x256 or 512x512 and so on.
     
  12. It's 512x512
     
  13. Alexander Knoll

    Alexander Knoll
    NEVER GIVE UP!!

    hi,
    for me the easyest way to get a working, not nice lookin, but working shader is to put the file in to modeler.exe in your main racer direktory.
    Import the .dof file and hit "make template shader" it's generate a basic file with all used shaders from your object....

    Alex

    modeler.jpg
     
  14. Thanks, i managed to write shader, but i still can see through rims on some pieces.. whats problem? [​IMG]

    Alex,i tried with that program, but when i press "make shader" and enter game, rims doesn't show up
     
  15. Alexander Knoll

    Alexander Knoll
    NEVER GIVE UP!!

    Oh, thats right...you have to copy the entres from the car_template.shd to your car.shd....
    hmm...take a look to the alpha channel from your rim texture, every thing you like "solid" should be white and every thing you want transparent, like holes or spokes should be black...

    Alex

    EDIT:
    ok here is a small example what i want to say with alpha channel:
    Main Texture:
    a110rim01.jpg
    Full "Solid" Alpha Channel:
    alpha_channel_1.jpg
    Alpha Channel with "holes":
    alpha_channel.jpg
    ...and this is what you get, with full solid alpha channel:
    Full_Solid.jpg

    ...and with "holes":
    with_holes.jpg

    ....i hope it helps a little...
     
  16. I don't have any car_template.shd in my folder....
    EDIT: i finnaly made it, ty for help all!