Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom shaders not working properly

#1
Hello,

I'm trying to apply a normal map on a wall and an environment map on a floor, both of them don't work at all, I don't know if there's something additional to do.

Here is the setup :

I've ran the map then executed the command "envmap kf_test 512".
My env textures are located at ~/.xonotic/data/env, they are named
Code:
kf_testbk.tga  kf_testdn.tga  kf_testft.tga  kf_testlf.tga  kf_testnx.tga  kf_testny.tga  kf_testnz.tga  kf_testpx.tga  kf_testpy.tga  kf_testpz.tga  kf_testrt.tga  kf_testup.tga

I'm using this code for the floor shader :
Code:
textures/Kafka/Floor01_env
{
        qer_editorimage textures/Kafka/Floor01
        dpreflectcube env/kf_test
        {
                map textures/Kafka/Floor01
        }
        {
                map $lightmap
                rgbgen identity
                tcgen lightmap
        }
}

And the shader is correctly applied in NetRadiant, but it's still the same texture in the game Sad

[Image: obgiul.jpg]

For the wall, I've used the GIMP with the normalmap plugin, I've saved the main texture as textures/Kafka/Brick08.tga and the result as textures/Kafka/Brick08_norm.tga, I've added a gloss texture for it too.

Here are the files I'd like to use :

Diffuse :
[Image: KxZrss.png]

Gloss :
[Image: 5mDR3.png]

Normal :
[Image: p8vlCs.jpg]

It doesn't work, I wonder what's going on...

Has anyone got an idea please ?

Best regards.
Reply

#2
If I remember correctly you don´t need a shader for textures like this. Important are the suffixes of your texture names. Normalmaps use the suffix "_norm", glossmaps/specularmaps "_gloss" and diffuse only the name. E.g.:

yourtexture.tga
yourtexture_gloss.tga
yourtexture_norm.tga

Also be sure you turned on normalmapping in your game settings!!!
Reply

#3
Thanks Maddin, I've just realized that the normal map was too weak to produce a 3d relief on the walls.
I've finally got the reflection working on the floor, thanks to Morphed on IRC for telling me to use reflection map.

[Image: kXxdbl.jpg]

But the reflection is following me like a skybox, is there a way to produce some kind of "static" reflection on the floor ?
How can I make the reflect less visible ? I've tried to lower the reflection map's opacity but it's still the same.
Reply

#4
What do you mean by reflection? Glossmapping (same as specularmapping), environment mapping or a mirror effect?
Reply

#5
I'd just like some mirror effect, like the water in solarium but static if it can save some performance, I'm pretty new in shading so I don't really know the right terms for that.
Reply

#6
To fake a mirror you use environment maps.

Code:
textures/pathto/texture
{
    qer_editorimage textures/pathto/editorimage
    {
        map textures/pathto/environmentimage        //this is the image which shows up as the environment map
        tcGen environment        //causes this stage to be an environment map
    }
    {
        map textures/pathto/maskimage        //must be an image with an alpha channel and transparent areas where you want the env map to show up
        alphaFunc GT0
    }
    {
        map $lightmap
        rgbGen identity
        tcGen lightmap
        blendfunc filter
    }

Haven´t tested the shader but it should work. Tongue

Also do not forget to add your shaderfilename to the shaderlist.txt file. Otherwise your shaders won´t work.
Reply

#7
you are trying to get the impossible mappers utopia ....

envoriment map (also known as cube maps) is what you currently have ... they work best in small places ... or when used weakly (and blured)

what you want is a mirror ... using a mirror can be bad on performance ... however ... if your map is constructed correctly you can get away with using mirros with almost no performance loss (look at drain for an example of this)

the other method is to make your floor semi transparent ... and then put an upside down copy of your room underneath it ... that may work better for larger rooms ....
Reply

#8
Many thanks both of you for your hints,
I've understood the shading system much better than before, I'm now using the "dp_reflect" keyword for a good-looking reflection, and I'm aware that it would lower the performance a lot, but I'll apply then the environment map as you said later.
Reply

#9
Btw: To make the environment map looking most suitable take a screenshot of your scene where the shader will be applied and use it (after some image editing of course) as your environment map. Wink
Reply

#10
or even better ... use the console command in xonotic to take a 360 box screenshot ...

but then ... it really depends on what type of envorment map you need ...

the windows in redplanet are only viewed from one direction ... so maddins method was used there
Reply

#11
Just a dump question: How to take that 360° screenshot? Tongue
Reply

#12
Quote:You can produce such a texture with this console command: envmap map/mapname/reflect1 512
Which will produce files such as:
map/mapname/reflect1px.tga map/mapname/reflect1py.tga map/mapname/reflect1pz.tga map/mapname/reflect1nx.tga map/mapname/reflect1ny.tga map/mapname/reflect1nz.tga
map/mapname/reflect1ft.tga map/mapname/reflect1rt.tga map/mapname/reflect1bk.tga map/mapname/reflect1lf.tga map/mapname/reflect1up.tga map/mapname/reflect1dn.tga


from

http://dpwiki.slipgateconstruct.com/inde...ion_for_DP
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Updated Xonotic gamepacks for NetRadiant and NetRadiant-custom SpiKe 3 2,348 11-16-2024, 04:49 AM
Last Post: SpiKe
Rainbow NetRadiant-custom Garux 25 14,806 03-06-2024, 04:31 PM
Last Post: anoob
  [NEED HELP] Custom NetRadiant Textures / Textures Not Loading 3agle427 3 4,695 09-03-2021, 01:40 PM
Last Post: HIBANEZ
  [SOLVED] TDM spawn points not working Nyx 2 1,950 08-07-2021, 02:20 AM
Last Post: Nyx
  Xonotic custom icon for profile users - editing image tutorial LegendGuard 4 3,092 12-14-2020, 12:16 PM
Last Post: Julius
  [NEED HELP] NetRadiant Models Not Working 3agle427 7 6,243 06-26-2020, 11:40 AM
Last Post: DarkFox
Wink Custom made crosshairs Draena 4 3,937 04-21-2020, 02:36 PM
Last Post: Cortez666
  [NEED HELP] Custom Skins 3agle427 0 10,945 01-14-2019, 08:01 PM
Last Post: 3agle427
  Defining custom particle effect types Notavi 2 2,827 08-05-2018, 06:31 AM
Last Post: Notavi
  NetRadiant - Some Textures Working / Some Not Notavi 1 3,511 05-16-2016, 03:50 PM
Last Post: Beagle

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB original theme © iAndrew 2016, remixed by -z-