Hello,
I'm creating a software with C# language for making pk3s and I can't find a way for parsing shaders. I've tried to use Regex but I think its kinda heavy, ANTLR for generating a complete parser but I can't find help for writing the grammar. Do you know a good evolutive way for doing it or any library?
Advertisement
Page 1 of 1
How to parse shaders?
#2
Posted 28 February 2014 - 06:44 PM
Look in tr_shader.c of the quake3 engine source. ParseShader especially.
https://github.com/B...rer/tr_shader.c
https://github.com/B...rer/tr_shader.c
#4
Posted 08 March 2014 - 07:10 AM
Hai!
I've finally explorated more ANTLR and now I'm able to parse shaders entirely. I've made some tests with some shaders and I got a problem with the deformVertexes normal directive. In the shader I have (for making flags), the directive is called with only 2 parameters instead of 5 like in the shader manual.
Is the manual wrong or not updated?
Here is the shader:
Another question, in the manual there is no q3map_fancywater reference. Where can I find an full list of every directive?
I've finally explorated more ANTLR and now I'm able to parse shaders entirely. I've made some tests with some shaders and I got a problem with the deformVertexes normal directive. In the shader I have (for making flags), the directive is called with only 2 parameters instead of 5 like in the shader manual.
Is the manual wrong or not updated?
Here is the shader:
textures/test/flag
{
qer_editorimage "textures/test/flag.tga"
q3map_globaltexture
deformVertexes wave 100 sin 4 3 0 0.3
deformVertexes wave 30 sin 0 3 0 .8
deformVertexes normal .3 .2
surfaceparm alphashadow
cull none
{
map "textures/test/flag.tga"
blendfunc GL_ONE GL_ZERO
alphafunc GE128
rgbGen identity
rgbGen const ( 1.0 1.0 1.0 )
depthwrite
}
{
map $lightmap
rgbGen identity
blendFunc GL_DST_COLOR GL_ZERO
depthFunc equal
}
}
Another question, in the manual there is no q3map_fancywater reference. Where can I find an full list of every directive?
Advertisement
#6
Posted 15 March 2014 - 08:40 PM
Finally I added the directive :)
I found an other one: light + int (or float?) in the azurea's script:
Does anyone have any information on it?
I found an other one: light + int (or float?) in the azurea's script:
textures/azurea_a2_sfx/s128-01wc
{
qer_editorimage textures/azurea_a2_trim/s128-01c.tga
q3map_lightimage textures/azurea_a2_sfx/s128-01b.blend.tga
light 1
surfaceparm nomarks
{
map $lightmap
rgbGen identity
}
{
map textures/azurea_a2_trim/s128-01c.tga
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
{
map textures/azurea_a2_sfx/s128-01b.blend.tga
blendfunc GL_ONE GL_ONE
rgbGen wave sin .3 .1 0 0.5
}
}
Does anyone have any information on it?
#8
Posted 16 March 2014 - 09:14 AM
Well, gsigms is a FS mapper and I read somewhere azurea was a map test for some new directives. Moreover, I found that parser where there are some directives that I didn't know. So I guess I should add them..
#9
Posted 16 March 2014 - 11:27 AM
n4w4k, on 16 March 2014 - 09:14 AM, said:
Moreover, I found that parser where there are some directives that I didn't know. So I guess I should add them..
That is from the 27's iobumpy engine so not all the stuff will work on a vanilla engine
Follow me: https://github.com/danielepantaleone
Page 1 of 1
1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users
Advertisement