Create an account

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


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
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 :
        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.

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.:


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

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.

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

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.

To fake a mirror you use environment maps.

    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.

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 ....

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.

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

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

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

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


Possibly Related Threads…
Thread Author Replies Views Last Post
Rainbow NetRadiant-custom Garux 25 13,704 03-06-2024, 04:31 PM
Last Post: anoob
  Updated Xonotic gamepacks for NetRadiant and NetRadiant-custom SpiKe 2 2,080 06-25-2023, 06:02 PM
Last Post: anoob
  [NEED HELP] Custom NetRadiant Textures / Textures Not Loading 3agle427 3 4,394 09-03-2021, 01:40 PM
Last Post: HIBANEZ
  [SOLVED] TDM spawn points not working Nyx 2 1,734 08-07-2021, 02:20 AM
Last Post: Nyx
  Xonotic custom icon for profile users - editing image tutorial LegendGuard 4 2,848 12-14-2020, 12:16 PM
Last Post: Julius
  [NEED HELP] NetRadiant Models Not Working 3agle427 7 5,743 06-26-2020, 11:40 AM
Last Post: DarkFox
Wink Custom made crosshairs Draena 4 3,517 04-21-2020, 02:36 PM
Last Post: Cortez666
  [NEED HELP] Custom Skins 3agle427 0 10,015 01-14-2019, 08:01 PM
Last Post: 3agle427
  Defining custom particle effect types Notavi 2 2,640 08-05-2018, 06:31 AM
Last Post: Notavi
  NetRadiant - Some Textures Working / Some Not Notavi 1 3,373 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-