Forums

Full Version: Scenegraph rewrite
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Win, rev 2707:

..\..\include\drawable.h|5|tr1/memory: No such file or directory|
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.
Quote:we lost the mouse grab, again. what the... this is the second time this is happening. i wonder what else got lost this time. i fixed this in svn, but can we please stop committing spurious changes? thanks.

I am sorry. I forgot to exclude this one before committing. I will try to be more careful in the future.
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.
Have you rebuilt the whole project?
I've cleaned everything, then rebuild and voila, it works!
NaN Wrote:Using render to texture + shader to bake the car texture. But for this I need to be able to load the custom shader and render the texture(outside of the scenegraph). The good thing is that I'll need this functionality for the dynamic sky anyway.

If their card can't run shaders, it's unlikely to support render to texture (framebuffer objects).

There's already functionality to render to textures (this is used by shadows, dynamic reflections, etc), although currently it's set up to happen each frame... if you need to bake something out once that'd have to be a special case.
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.

[Image: shot0109h2lz.jpg]

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?
I think we want it full resolution. Using the alpha from the miscmap texture sounds like a good way to go.
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.
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.
Yeah, I can hook that up once you check in the shader path changes.
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
The assert is a bug from when I did the scenegraph refactor, I've fixed that in R2717. Still looking into the drawable color thing.
NaN Wrote:1. Changing the color of the drawable doesn't work. Do we copy the drawables somewhere? Or am I doing it the wrong way?

You were doing it the right way EXCEPT the spinning car widget is hacky and does indeed copy over the scenegraph at load time so it can manipulate it. I fixed the update in R2718; now it copies the scenegraph over every time you change the color (turns out it's pretty quick).
Pages: 1 2 3 4