Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / Completing lights branch - integration into object rendering
1 2 Previous Next
Parent - - By Sven2 Date 2014-11-07 10:44
There's also stuff like the castle site in the raid mission which only appears once in the game and would be a lot of work to recreate as a model. But drawing a normal map shouldn't be too hard.

Also I don't believe in waiting on branches.
Parent - - By Newton [de] Date 2014-11-07 13:27 Edited 2014-11-07 13:32
True. You are right that there are use cases for normal maps on sprites. Mostly, I think this feature would make sense for static decoration background objects. For small objects and the resources in particular, I think it would't look good. See here. Haven't gotten around to trying out Clonk-Karl's suggested shader code yet though (and won't be able to in the next few days). My suggestion about the lighting of sprites and normal maps on sprites seem to be mutually exclusive though.

> Also I don't believe in waiting on branches.


Point taken.
Parent - By Clonk-Karl [us] Date 2014-11-07 14:14

> My suggestion about the lighting of sprites and normal maps on sprites seem to be mutually exclusive though.


Well, one easy possibility would be: If an object has a normal map, then the normal map is used, and otherwise the intensity-only lighting.
Reply
Parent - - By Clonk-Karl [us] Date 2014-11-07 21:45 Edited 2014-11-07 22:01
I have implemented normal maps for sprite graphics, and tried it out with the firestone. Just place a file called Normal.png with the same dimensions as Graphics.png in the object definition. The firestone normal map itself was generated with a small script, and can certainly be tweaked somewhat more. The second screenshot compares the looks of a fire stone (with normal map) and a loam (without normal map). When a sprite does not have a normal map, only the light intensity is now applied, and the light direction is ignored.
Reply
Parent - By Pyrit Date 2014-11-07 22:24
Looks really good, but I maybe wouldn't make the shadow on the edge 100% black
Parent - - By Maikel Date 2014-11-07 09:11
Great work!
Parent - By Mortimer [de] Date 2014-11-07 14:13
+1
Reply
Parent - By PeterW [de] Date 2014-11-15 00:02
Nice. And yes, that sounds like what I was using for the normal calculation as well. Nothing set in stone here - we just need to find something that looks good but doesn't cost us too much on the GPU.

> * The clonk is now also lightening up the sky right behind it, like it would light up tunnel. Maybe that should not happen.


Yeah - the idea was that the sun would basically guarantee that Sky was always illuminated. Still can't figure out the technical details though. With the current code we'd need some other kind of special case for Sky, I feel...

Also note that the normal calculation only happens at triangle points (with linear interpolation in between). This unfortunately means that the fade is different depending on how far away the beam end is. If somebody wants to fix this - this would require splitting the main ray triangle into a triangle (until the point where normals max out) and a quad for the homogeneous parts. That should then give a "circle" around the Clonk as it should be.

Also have been working a bit on fixing the issue with the rounding artefacts. You'd just need to blend the old state over the frame buffer, I think. Simple in theory, but my OpenGL-Fu isn't good enough to figure out how.  I *think* this requires glTexEnv, but that's marked with a "use shaders instead", so I got side-tracked trying to generalise shaders yet again...
Parent - - By Newton [de] Date 2014-11-11 22:27
After I updated the lights branch, whenever I launch tutorial 1, I get this exception at startup. Is this related to your changes?:

   openclonk-debug.exe!std::vector<C4BltVertex,std::allocator<C4BltVertex> >::operator[](unsigned __int64 _Pos) Line 1141  C++
   openclonk-debug.exe!C4PXSSystem::Draw(C4TargetFacet & cgo) Line 346  C++
   openclonk-debug.exe!C4Viewport::Draw(C4TargetFacet & cgo0, bool fDrawOverlay) Line 246  C++
   openclonk-debug.exe!C4Viewport::Execute() Line 336  C++
   openclonk-debug.exe!C4ViewportWindow::PerformUpdate() Line 179  C++
   openclonk-debug.exe!C4Window::RequestUpdate() Line 1051  C++
   openclonk-debug.exe!C4ViewportList::Execute(bool DrawBackground) Line 753  C++
   openclonk-debug.exe!C4GraphicsSystem::Execute() Line 136  C++
   openclonk-debug.exe!ViewportWinProc(HWND__ * hwnd, unsigned int uMsg, unsigned __int64 wParam, __int64 lParam) Line 315  C++


pixVtx (and lineVtx) has a size of 0.
Parent - - By Clonk-Karl [us] Date 2014-11-12 14:53
Zapper had a fix for this, but apparently not committed? Should be fixed now.
Reply
Parent - - By Zapper [de] Date 2014-11-12 18:13
I forgot to pick it into master
Parent - By Newton [de] Date 2014-11-13 21:52
Jupp, fix worked. Thank you.
Up Topic Development / Developer's Corner / Completing lights branch - integration into object rendering
1 2 Previous Next

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill