Inside3D!
     

How to make DP render flat-shaded?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Tue Apr 27, 2010 9:04 am    Post subject: How to make DP render flat-shaded? Reply with quote

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
View user's profile Send private message Visit poster's website
Supa



Joined: 26 Oct 2004
Posts: 122

PostPosted: Tue Apr 27, 2010 11:43 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Tue Apr 27, 2010 12:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Tue Apr 27, 2010 12:20 pm    Post subject: Reply with quote

Supa: I take it you mean making stuff single-colored? I already do that the same way you do Smile. 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
View user's profile Send private message Visit poster's website
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Tue Apr 27, 2010 12:23 pm    Post subject: Reply with quote

Urre wrote:
I already do that the same way you do Smile

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
View user's profile Send private message
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Tue Apr 27, 2010 12:33 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Supa



Joined: 26 Oct 2004
Posts: 122

PostPosted: Tue Apr 27, 2010 12:41 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Tue May 04, 2010 1:29 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Tue May 04, 2010 3:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Tue May 04, 2010 9:34 pm    Post subject: Reply with quote

That'd do it. Any simple way to do it with QME? :S
_________________
Look out for Twigboy
Back to top
View user's profile Send private message Visit poster's website
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Wed May 05, 2010 3:31 am    Post subject: Reply with quote

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
View user's profile Send private message
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Wed May 05, 2010 8:23 am    Post subject: Reply with quote

I am only concerned with MDL's yes. I will try that, thanks!
_________________
Look out for Twigboy
Back to top
View user's profile Send private message Visit poster's website
mh



Joined: 12 Jan 2008
Posts: 909

PostPosted: Wed May 05, 2010 9:11 am    Post subject: Reply with quote

Now I'm confused too. Unless I'm reading things very wrong, isn't this the same as what gl_smoothmodels 0 does?
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Wed May 05, 2010 2:53 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
mh



Joined: 12 Jan 2008
Posts: 909

PostPosted: Wed May 05, 2010 5:05 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group