View previous topic :: View next topic |
Author |
Message |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Tue Apr 27, 2010 9:04 am Post subject: How to make DP render flat-shaded? |
|
|
Not exactly a QC question, but I guess this forum is the most fitting. Does anyone know how I would make DP render models flat-shaded? _________________ Look out for Twigboy |
|
Back to top |
|
 |
Supa

Joined: 26 Oct 2004 Posts: 122
|
Posted: Tue Apr 27, 2010 11:43 am Post subject: |
|
|
Did you try r_showsurfaces 3 yet? Other than that I've had to resort to 4x4 solid colour skins, so I'd be interested in hearing a proper way to do this too. :) |
|
Back to top |
|
 |
leileilol

Joined: 15 Oct 2004 Posts: 1321
|
Posted: Tue Apr 27, 2010 12:06 pm Post subject: |
|
|
I think he means non-normal lighting stuff. I'd suggest just tearing apart the default.glsl after dumping it, and get rid of attenuation ramps in the lighting. This will screw up map lighting if you use rtworld _________________
 |
|
Back to top |
|
 |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Tue Apr 27, 2010 12:20 pm Post subject: |
|
|
Supa: I take it you mean making stuff single-colored? I already do that the same way you do . There is however a proper way to do this, DP got support for vertex colors per mesh in q3shaders some while ago, haven't tested it.
leileilol: Screws up how? I'd like to keep realtime lights. Also, care to post an example default.glsl?
On a separate note, is there a way to dynamicly change which *.glsl file is used, like a stuffcmd or something? _________________ Look out for Twigboy |
|
Back to top |
|
 |
leileilol

Joined: 15 Oct 2004 Posts: 1321
|
Posted: Tue Apr 27, 2010 12:23 pm Post subject: |
|
|
Urre wrote: | I already do that the same way you do  |
you could go further with colormod abuse or even scripts/ .shader, with map $whiteimage and rgbGen const to save even more texture memory
I wouldn't recommend uploading a glsl file as an 'example' since revisions of DP could render it obsolete. There is a command in DP that dumps it though. _________________
 |
|
Back to top |
|
 |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Tue Apr 27, 2010 12:33 pm Post subject: |
|
|
leileilol wrote: | I wouldn't recommend uploading a glsl file as an 'example' since revisions of DP could render it obsolete. |
That has always been and always will be the case with DP, but it'd be better than nothing, if you know what needs to be changed. I haven't touched GLSL yet, so I wouldn't know where to start. _________________ Look out for Twigboy |
|
Back to top |
|
 |
Supa

Joined: 26 Oct 2004 Posts: 122
|
Posted: Tue Apr 27, 2010 12:41 pm Post subject: |
|
|
leilei; Thanks. :)
Urre wrote: | On a separate note, is there a way to dynamicly change which *.glsl file is used, like a stuffcmd or something? |
Right now all you can do is reload the defaults. I've talked with LH about it before and he has expressed an interest in seperating everything into multiple scripts and providing a means to load new scripts on the fly, but given what he's working on at the moment there's no telling when he'd be able to do that. |
|
Back to top |
|
 |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Tue May 04, 2010 1:29 pm Post subject: |
|
|
I can't get this working. Anyone GLSL proficient want to give it a shot? I'd actually want this to be a cvar, and not bound to GLSL only :S _________________ Look out for Twigboy |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Tue May 04, 2010 3:17 pm Post subject: |
|
|
I'm not sure what you want. If you're looking for "faceted" lighting, I don't know if it's possible without modifying the engine, since you need the triangle normals. Probably the best idea is just to process your models, splitting all vertices up so you have 3x more vertices than triangles. _________________ F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe. |
|
Back to top |
|
 |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Tue May 04, 2010 9:34 pm Post subject: |
|
|
That'd do it. Any simple way to do it with QME? :S _________________ Look out for Twigboy |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Wed May 05, 2010 3:31 am Post subject: |
|
|
If you are only concerned with MDLs, then I will get right on the "MDL tool" that someone else wanted for fixing texturemapping. This could be a simple feature added to that tool.
Actually, If I recall, QWalk can do this with the "-facetize" argument. But it would involve importing MDL then exporting MDL, which is not recommended using that tool. You could still try it as a test though. _________________ F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe. |
|
Back to top |
|
 |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Wed May 05, 2010 8:23 am Post subject: |
|
|
I am only concerned with MDL's yes. I will try that, thanks! _________________ Look out for Twigboy |
|
Back to top |
|
 |
mh

Joined: 12 Jan 2008 Posts: 910
|
|
Back to top |
|
 |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Wed May 05, 2010 2:53 pm Post subject: |
|
|
mh: Sounds like it, except DP doesn't have such a cvar. Do other Quake engines have it?
And how can flat-shaded be confusing? That's what it's called in every modeling software out there. I want to disable the smoothing, yes. _________________ Look out for Twigboy |
|
Back to top |
|
 |
mh

Joined: 12 Jan 2008 Posts: 910
|
Posted: Wed May 05, 2010 5:05 pm Post subject: |
|
|
Most GLQuake-derived engines should still have it, it's just the lines: Code: | if (gl_smoothmodels.value)
glShadeModel (GL_SMOOTH); | in R_DrawAliasModel.
FitzQuake definitely has it, and it should be there in DirectQ too (although it's not a lighting mode I test too often so I can't confirm it works). I'd be shocked if ProQuake didn't have it, and I don't really know about other engines, but it's in ID's code so unless the author removed it it should still be there.
Maybe LH removed it from DP for some reason?
I'm not certain that it would be possible to implement this in a shader as the color values for each vertex would require knowledge of the values for other vertexes, as well as knowledge of when each primitive begins and ends. That's far beyond the remit of a vertex shader (and not even relevant for a fragment/pixel shader).
A shader is definitely overkill for this kind of thing anyway; I'd say petition LH to reinstate it instead. _________________ DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines |
|
Back to top |
|
 |
|