05-07-2010, 12:17 PM,
|
|
nomoo
Member
|
Posts: 111
Threads: 15
Joined: Mar 2007
|
|
Win, rev 2707:
..\..\include\drawable.h|5|tr1/memory: No such file or directory|
|
|
05-07-2010, 12:20 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
What compiler are you using?
Edit:
If you are using MinGW/GCC. GCC version should be > 4.0 for tr1 I think.
http://www.tdragon.net/recentgcc/
http://code.google.com/p/qp-gcc/
I've recently switched to http://mingw-w64.sourceforge.net/
And use mingw-w32-bin_i686-mingw_20100428_sezero.zip to compile vdrift on Windows.
|
|
05-07-2010, 01:11 PM,
|
|
nomoo
Member
|
Posts: 111
Threads: 15
Joined: Mar 2007
|
|
Yes, gcc was 3x. With 4x everything is ok.
edit:
'Ok' means that i got executable, but when i'm trying to run it i see only error message and nothing else. No stderr or stdout files.
|
|
05-07-2010, 02:56 PM,
|
|
nomoo
Member
|
Posts: 111
Threads: 15
Joined: Mar 2007
|
|
I've cleaned everything, then rebuild and voila, it works!
|
|
05-10-2010, 11:24 AM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
I've been playing with the shaders recently. To avoid having a diffuse and a skin texture for cars. I decided to use the drawable object color.
The opacity of the object is controlled by its color alpha:
1.0 means opaque(alpha blend texture with object color, car body)
0.5 opacity is equal to texture alpha(default)
0.0 transparent
Changes in fragment.glsl:
Code: vec3 surfacecolor = mix(gl_Color.rgb, tu0_2D_val.rgb, tu0_2D_val.a);
...
gl_FragColor.a = alpha + 2 * gl_Color.a - 1;
I don't think this is possible in the fixed function pipeline, right?
The ambient occlusion could be stored in the free color channel of the misc1 map to save samplers. On the other side the occlusion data is low frequency so it could be much smaller than the other textures. What do you think?
|
|
05-11-2010, 09:42 AM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
I've been thinking about multi texturing before the shaders came up.
I think we could emulate texture vertex color blending:
Code: gl_FragColor.rgb = mix(gl_Color.rgb, tu0_2D_val.rgb, tu0_2D_val.a);
with:
Code: glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texture);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_INTERPOLATE);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PRIMARY_COLOR_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB, GL_TEXTURE);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB, GL_TEXTURE);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_SRC_ALPHA);
But I don't know how to combine the alphas:
Code: gl_FragColor.a = tu0_2D_val.a + 2 * gl_Color.a - 1;
Does it make sense to use texture combiners? I think they have been deprecated in OpenGL 3.0. I just want to avoid doing it in software.
|
|
05-11-2010, 10:57 AM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
We have a car_noblend layer:
Code: CONTAINER <DRAWABLE> car_noblend;
Is it possible to plug in the texture combiner code(as fall back for no shader) for this drawables, so that they are threated as opaque objects with a diffuse texture having an alpha channel as color blending factor?
Then there would be no need to care about correct alpha combining as car_noblend would be defined as opaque.
|
|
05-12-2010, 05:37 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
I checked in the code. To test use XS with paint 00.
There are to issues left where I need your help:
1. Changing the color of the drawable doesn't work. Do we copy the drawables somewhere? Or am I doing it the wrong way?
2. Adding opponents will trigger containerid assertion. It happens when the "SingleRace" pagenode is retrieved. I have no idea what I've messed up here.
Code: Assertion failed: key.containerid == containerid, file ..\..\include/keyed_container.h, line 396
|
|
|