Hello all,
After a week or so spent familiarizing myself with the project's structure and OSG, I've written what I believe is a reasonable approximation of magic bolt projectile lights in Morrowind, Feature #3523. As this is my first experience with C++, let alone OSG, I don't know if I'm ready to apply to be a developer, but I thought I'd still post here to see if I could find some helpful criticism and advice.
The comparison is here: Link
A bit of testing seems to show that the spell light color might change slightly depending on the spell, but it's a bit hard to tell. If this is the case, my next task would be to find some way of retrieving that information to set the light colors.
Please ignore the "added" indentations in a few places. VS2015 and Notepad++ can't see them, but Github thinks it can. Does anyone know why that might be, as an aside? Fixed!
Thanks!
Projectile Lights
Projectile Lights
Last edited by Aussiemon on 05 Dec 2016, 00:49, edited 2 times in total.
Re: Projectile Lights
Looks good. I have some very minor criticism, but I'll save that for when you create a PR (more convenient to comment on individual lines).
You've used tabs instead of spaces. We use exclusively spaces, in fact, our CI server will reject code that contains tabsPlease ignore the "added" indentations in a few places. VS2015 and Notepad++ can't see them, but Github thinks it can. Does anyone know why that might be, as an aside?
Try using the showSceneGraph command in Morrowind, find the projectile node, and you can see the exact colors that are being used. Might be dependent on the color set in the ESM::MagicEffect's that the spell includes. It is also possible there is one light source per effect.A bit of testing seems to show that the spell light color might change slightly depending on the spell, but it's a bit hard to tell. If this is the case, my next task would be to find some way of retrieving that information to set the light colors.
Re: Projectile Lights
Please, do not use tabs for indenting.Aussiemon wrote:Please ignore the "added" indentations in a few places. VS2015 and Notepad++ can't see them, but Github thinks it can. Does anyone know why that might be, as an aside?
OpenMW Code Formatting Conventions:
Note that the indention width is 4 spaces. We are not too strict about these rules, but if you use tabs instead of spaces, you have a decent chance to piss us off. Mixing spaces and tabs is not good.
Re: Projectile Lights
High praise! Here is the pull request.scrawl wrote:Looks good. I have some very minor criticism, but I'll save that for when you create a PR (more convenient to comment on individual lines).
Try using the showSceneGraph command in Morrowind, find the projectile node, and you can see the exact colors that are being used. Might be dependent on the color set in the ESM::MagicEffect's that the spell includes. It is also possible there is one light source per effect.
That command is very helpful.
I've examined two spell projectile nodes (relvel_damage, fireball_bar_uni) with different effects. Both nodes contained a single light (even with multiple effects) and different diffusion values. I'll see about pulling the diffusion value from the color set you mentioned next.
If you're able to see those images, do the light values correspond directly to OpenGL equivalents? Do Atten0, Atten1, Atten2 = constant, linear, quadratic attenuation values?
That's a very helpful link, thank you! I should've guessed that this was the reason.jirka642 wrote:Please, do not use tabs for indenting.Aussiemon wrote:Please ignore the "added" indentations in a few places. VS2015 and Notepad++ can't see them, but Github thinks it can. Does anyone know why that might be, as an aside?
OpenMW Code Formatting Conventions:Note that the indention width is 4 spaces. We are not too strict about these rules, but if you use tabs instead of spaces, you have a decent chance to piss us off. Mixing spaces and tabs is not good.
Re: Projectile Lights
Yes, they should. m_kSpec you can ignore, Morrowind does not use specular lighting.If you're able to see those images, do the light values correspond directly to OpenGL equivalents? Do Atten0, Atten1, Atten2 = constant, linear, quadratic attenuation values?
Re: Projectile Lights
Okay, I've implemented color retrieval, and testing shows that the blended values match the properties of the vanilla light nodes.
Are there any problems remaining with my implementation?
Are there any problems remaining with my implementation?