Page 6 of 21

Posted: Sun Apr 15, 2007 2:41 pm
by Star Gazer
...mmmm... ...well, I can't see any difference with that change of code... :?

Posted: Sun Apr 15, 2007 2:58 pm
by JensAyton
Change from the buggy stuff, or change from the stuff that looked fixed but wasn’t?

Do you still get the log message about bad code that you forgot to check for last time? :-)

Posted: Sun Apr 15, 2007 5:21 pm
by Star Gazer
Looked OK, but just like the previous series with no shaders present.

No log messages.

EDIT
oooops....make that HUGE console messages... :oops: ...all like this...
Oolite [shader.compile.fragment.failure]: ***** GLSL fragment shader compilation failed:
>>>>> GLSL log:
ERROR: 0:75: 'vec4' : syntax error parse error


>>>>> GLSL source code:
...
....gl_FragColor = color;
}


Oolite [shader.compile.fragment.failure]: ***** GLSL fragment shader compilation failed:
>>>>> GLSL log:
ERROR: 0:77: 'vec4' : syntax error parse error


>>>>> GLSL source code:
...
...gColor = vec4(color.rgb, 1.0);
}


Oolite [rendering.opengl.error]: OpenGL error: 'invalid value' (1281) in: Universe before doing anything

Posted: Sun Apr 15, 2007 7:03 pm
by Star Gazer
OK. I've emailed some new pictures - re-examined the code only to realise that I had made a mistake... :oops: MANY apologies... :roll:

Posted: Mon Apr 16, 2007 7:38 pm
by JensAyton
Bug-fix shadification. Also changed the shaders a bit, so the specular highlights are broader (less varnish-smooth surface) and brighter. Ideally, for this ship, I’d want about 1/3 to 1/2 the brightness, but for demonstration purposes you want them noticable. :-)

Of course, that’s ultimately a decision for the artist to make when he bundles it up, makes a wiki page and publishes the thing. *Hint, hint*

Now, does anyone have a smoothed model which would benefit from specular highlights? Per-pixel lighting effects are wasted on flat surfaces…

Posted: Mon Apr 16, 2007 9:23 pm
by Griff
Ahruman
Sorry i haven't posted for a bit... um, i've got a feeling this might make you a bit cross but now just as you've perfected your shaders I've only just gone and uploaded a re-UV mapped version of the griff krait here http://www.box.net/shared/ay48q88f7z with a re-done specularity map using the red & green channels for specular exponent & intensity
I was also a bit alarmed at how many texture maps this one ship needed so i've rescaled all the diffuse maps & effects/glow maps into 1 map each rather that lots of maps for various subentities, this means that the specular map now covers the entire ship rather than just the hull, i've also modified the effects maps to include more areas of the engine and laser cannons.
Also, cool news is that Ahrumans shaders can be easily pasted into Rendermonkey which lets us non-programmer types view the workings of his shader code:-
Image
here i'm checking out the glow map ahruman linked to the 'engine_level' data from oolite. great stuff!

Posted: Mon Apr 16, 2007 9:40 pm
by JensAyton
Cross? Don’t be silly. I want you lot to get into the habit of doing your own shaders.

Some tips, though: instead of toning down the specular intensity in the texture map, it’d be better to multiply it by a scaling factor in the shader (as in, float specIntensity = specMap.g * 0.3;). This would provide greater precision. (This would also allow the intensity and exponent to share a channel, since they don’t appear to differ except in scale). Also, you could put the engine_level texture into the blue channel of the effects_map, and use a function to generate the appropriate colour (just like the temperature and engine glows).

The most important tip, though, would be to provide a version that actually includes the shaders and the relevant shipdata.plist entries. :-)

Posted: Mon Apr 16, 2007 11:07 pm
by JensAyton
Oh, yeah, I forgot one nitpick: the Read Me file is inside the OXP, where many users, and almost all Mac users, will not see it.

Posted: Tue Apr 17, 2007 7:52 am
by Griff
Sorry about the readme file being inside the .oxp folder, i was rushing to upload it all last night, i've fixed that now. heh, so, you noticed i left out all the shaders :) Man, they're too complex for my poor brain! I bought the 'shaders for game programmers and artists' book, it doesn't actually teach OpenGl - all the shaders are written for directX, but it does use rendermonkey a lot and hopefully the theories will transfer easily over to openGl, at the moment i'm busy vandalising your fragment shaders in rendermonkey, i want to try and get the 'sun' light in there (for the purpose to previewing specularity maps). BTW the shader fixed version you recently posted works great, no blueness in the textures and lovely glinting highlights, what was causing the blueness? was it the black in the background of the hull glow map? i was trying some experiments with glow maps of different coloured backgrounds as i wondered if the black was mixing in with the diffuse texture but my experiments failed :(

Posted: Tue Apr 17, 2007 8:29 am
by JensAyton
The “sun” light is light number 1. Light 0 is the “preview spotlight”, which is currently attached to the camera at all times. For testing purposes, you can set a fixed light position by changing the line “vec3 lightVector = normalize(gl_LightSource[idx].position.xyz); \” to something like “vec3 lightVector = normalize(vec3(-30.0, 50.0, 50.0)); \”.

The same general theory of lighting and so forth should apply to any shading language.

The bug was due to not initializing the diffuse and specular variables to 0.

Posted: Tue Apr 17, 2007 5:54 pm
by Arexack_Heretic
(replying to some of the initial posts in this thread)

I can see the resemblance to KRait,
when you suppose the old vector grafic is a very simplified scematic representation of the shape of a shipclass.

The model is very pretty, but somehow gives the impression of being a light fighter/interceptor craft, instead of a heavy insystem-defence vessel.
(the size of the nice equipment modules increases this feel)

(Krait is very large in comparison to similar craft. Possibly only because of gameplay, easytohit, reasons)

Posted: Sat Apr 21, 2007 3:54 pm
by Frame
i recently tested your krait, and everytime i encounter your krait, on my 2.4 ghz windows XP 1,5 GB DDR ram with an ATI x800 XT GFX 256 MB DDR card, it staggers the system. I would really hate to battle 6 of these...

Since it would make my system go like 1.5 fps....

Posted: Sat Apr 21, 2007 8:48 pm
by Griff
guys, thanks for the feedback, heh, yes it is a bit of a frame rate killer! i made the ship just for a bit of fun really, to test how oolite coped with very high poly count ships (it does a great job!) and how much i could muck about with the designs, I shouldn't really have called this ship a krait! Anyway, i've a lower texture version of it on the go at the moment which i'll post up in a bit, just have to knuckle down and copy ahrumans shader code into it, maybe the lower number of texture maps will help your frame rate, plus there will be 'poorer pilot' versions which don't have all the fancy extra items on them which will lower the poly count considerably. i'm trying to find info on your graphics card, judging by the bechmarks on tomshardware that's a really good graphics card, i'm puzzled because your system is better than mine, i've got an athlon2100xp Ghz CPU, 512MB ram and a ATi9500pro 128MB graphics card yet i can battle up to 12 of these before the frame rate gets a bit choppy! computers eh? who'd have em.

Posted: Sat Apr 21, 2007 9:03 pm
by JensAyton
It sounds as though it’s dropping into software fallback mode for shaders, which it shouldn’t – the x800 (R420) has much better shader support than my GeForce FX 5200, which is fine with the Griff Krait unless it’s very close (i.e., taking up a large portion of the screen).

Are your drivers up to date?

(It’s possible to check whether a shader is being rendered in hardware or software under OS X, which I intend to do by the next non-testing release, but the method is very closely tied to OS X’s OpenGL implementation, and it’s quite likely that there’s no equivalent for other platforms.)

Posted: Sun Apr 22, 2007 1:15 pm
by Frame
Ahruman wrote:
It sounds as though it’s dropping into software fallback mode for shaders, which it shouldn’t – the x800 (R420) has much better shader support than my GeForce FX 5200, which is fine with the Griff Krait unless it’s very close (i.e., taking up a large portion of the screen).

Are your drivers up to date?
I stayed away from updating the ATI drivers, since it causes some other system specific problems... ATI drivers never work completely. you always has to use dated/fixed ones :S...

But i updated anyway... as bonus, procedual texturing on planets is generated much faster now...

i havent had the luck to bump into a krait yet... but will report back when i do...

Edit

I finally bumped into a krait... and sure enough, it was the dated drivers...
no staggering at all, even when two are around, the PC runs at 60 fps...

i have a good picture of griffs Krait, but nowhere to upload it :-/