Xonotic Forums
[?] Shader Editor / Syntax - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Creating & Contributing (https://forums.xonotic.org/forumdisplay.php?fid=10)
+--- Forum: Xonotic - Development (https://forums.xonotic.org/forumdisplay.php?fid=12)
+--- Thread: [?] Shader Editor / Syntax (/showthread.php?tid=7760)



[?] Shader Editor / Syntax - _para - 07-06-2018

Is there some kind of GUI Editor for the .shader scripts?
Or an tutorial also explaining the syntax and list of commands/functions?

I'd really like to get a gold texture with cube-mapping.
Maybe crystal and other kind of fancy stuff. (that ambiguity)

But first I'd like to understand how it works or if theres a handy tool that fosters my laziness.


RE: [?] Shader Editor / Syntax - Mario - 07-06-2018

I believe this is the resource I usually use: http://toolz.nexuizninjaz.com/shader/


RE: [?] Shader Editor / Syntax - _para - 07-07-2018

Thanks! That's exactly what I was looking for.

Also I should have done a google search. I was sure I already did search for 'q2 shaders' but not directly 'xonotic shader'. Well... https://forums.xonotic.org/showthread.php?tid=5667
Can be merged I guess.


RE: [?] Shader Editor / Syntax - Julius - 07-08-2018

Shader files are plain text, so use your favorite text editor.

In regards to cubemaps for fake reflections: they work well with small size textures (256, 512), with blur applied and with some high intensity light spots.


This is the exomorph cubemap included with Xonotic (env/exomorph/exomorph):

[Image: cxEdJOM.png]



PD: If you are using Garu's NetRadiant (Windows release) then you have a local copy of the shaders manual in the Help menu.


RE: [?] Shader Editor / Syntax - Julius - 07-08-2018

Also, you can create a cubemap -automagically- from your own map this way:

envmap <cubemapname> 512


PD: The above is a command to run in Xon console. It puts the cubemap images in ~/.xonotic/data/env


RE: [?] Shader Editor / Syntax - _para - 07-08-2018

Nice thanks! I think I stumbled upon this command a while ago without knowing that I could specify a name.
Are cubemaps automatically applied to the _reflect.<jpg/dds/...> map of a texture or do I have to tinker with .shader files?

Second question: Aside from using linux how did you get your gimp to look so beautifully? Maybe my version is too old(2.8) but my gimp well...

[Image: VL6Jv3D.png]

(05-12-2018, 08:08 AM)Mario Wrote: PD: If you are using Garu's NetRadiant (Windows release) then you have a local copy of the shaders manual in the Help menu.

Nice that's good to know.


RE: [?] Shader Editor / Syntax - Julius - 07-08-2018

To apply the fake reflection provided by a cubemap, your texture need a shader directive and a texturename_reflect.tga file.

This is a shader example for a "cubemaped" metal:



Code:
textures/map_testmap2/met_copper1
{
    qer_editorImage textures/map_testmap2/metal/met_copper1.tga

    q3map_bounceScale 2.0
    dpGlossIntensityMod 0.50       // 0.70
    dpGlossExponentMod 0.25        // 2.00

    dpReflectCube env/cubemaps/exomorph

    {
        map textures/map_testmap2/metal/met_copper1.tga
        rgbGen identity
    }
    {
        map $lightmap
        rgbGen identity
        blendFunc filter
    }
}

[Image: Nob4ei5.jpg]


[Image: BCj2W21.jpg]


The _reflect file  accompanying the texture is used to indicate in wich part of the texture the effect must be applied and the intensity or amount of the effect. In the screenshots above  I'm using _reflect files of plain/flat grey (32,32,32 RGB).


Related to Gimp, yes, I'm a Linux user and I'm using the latest 2.10.4 release with the new icons and dark theme, in single-window mode (Gimp 2.8 has it in "Windows" menu) and my own layout for the tools-bar and tabs/panels, exactly as I was using it with 2.8 before.

.