Kerbal Space Progam + Oculus Rift shader analyzer question.

The place for all discussion of the Oculus Rift compatible open source 3D drivers.
Post Reply
Archimid
One Eyed Hopeful
Posts: 10
Joined: Thu Nov 28, 2013 4:44 pm

Kerbal Space Progam + Oculus Rift shader analyzer question.

Post by Archimid »

Hello, so i'm trying to improve KSP+Perception+OR. currentlly I created a gameprofile and I'm learning the ropes with the shader analyzer. Currently I'm getting the following rules from the shader analyzer.

Code: Select all

<?xml version="1.0"?>
<shaderConfig>
	<rules />
	<defaultRuleIDs />
</shaderConfig>
WHat puzzles me the most is that this seems to me like improperly formatted XML. IS this expected behavior? Also I never get the green rectangles mentioned on the documentation. This is what i do to get this xml

1. Run Perception.exe
2. Run KSP.exe
3. Get to a launch scene
4. CTRL+T
5. Activate Shader Analyzer
6. Create new rules
7.CTRL+T
8. Activate Shader Analyzer
9. save rules.



Any insight will be welcomed.
User avatar
EisernSchild
Vireio Perception Developer
Vireio Perception Developer
Posts: 225
Joined: Tue Jun 11, 2013 9:39 am
Location: Graz / Austria

Re: Kerbal Space Progam + Oculus Rift shader analyzer quest

Post by EisernSchild »

Hi Archimid !

This is a corrupt and empty shader analyzer file. The shader analyzer did not find anything using the keywords in "cfg//shader_rules//brassa.cfg". You can edit this file adding additional keywords that match KSPs shader constant names for the projection matrix.

There should be a .csv file in the games directory ("shaderDump.csv") where you should find all possible matrix names. Use a csv editor to sort the names ( i use CSVEd ). If you can't find a matching name for a projection matrix send me a download link for the csv file, i will take a look.

Regards, Denis
Archimid
One Eyed Hopeful
Posts: 10
Joined: Thu Nov 28, 2013 4:44 pm

Re: Kerbal Space Progam + Oculus Rift shader analyzer quest

Post by Archimid »

Fantastic! its working as intended. I had a suspicion this could be the problem. I have added several key words that I have found. I'm not sure but this is what I think so far please correct me if I'm wrong. The unity class for the projection matrix is Matrix4x4, which is called along any custom projection matrices by the game. These names must be added to the BRASSA.cfg. Under this assumptions I figure that the best guide would be this KSP modding xml https://github.com/Anatid/XML-Documenta ... Engine.xml I have added the following words with out success but I'll keep adding. I will also add in the KSP forums as they might know exactly what I have to look for.
Matrix4x4
matrix4x4
matrix

I found the "shaderDump.csv" but it only has headers in it. Should I do something to populate it? Thanks for the tips.
User avatar
EisernSchild
Vireio Perception Developer
Vireio Perception Developer
Posts: 225
Joined: Tue Jun 11, 2013 9:39 am
Location: Graz / Austria

Re: Kerbal Space Progam + Oculus Rift shader analyzer quest

Post by EisernSchild »

The keywords you added can't be found since they match the constant type and not the constant name.

If the .csv file is empty try to start the game again in shader analyzer mode and exit while beeing in game mode and not in the main menu. The analyzer will gather every shader constant it has found so far.
Archimid
One Eyed Hopeful
Posts: 10
Joined: Thu Nov 28, 2013 4:44 pm

Re: Kerbal Space Progam + Oculus Rift shader analyzer quest

Post by Archimid »

As I was looking for constant names for the projection matrix I found this thread in Unity Answers:

"Unity uses Transforms for rendering and for physics interactions. To this end, it does not store transformation matrices explicitly. Translation, rotation and scale are actually stored as vectors and quaternions, and transformation matrices are generated as needed."


There is more details on the thread but , the writer implies that Unity handles transformation matrices very differently than other game engines. Perhaps thats why I cant seem to get a list of matrix constants, since unity don't rely on projection matrices, I'm thinking that there might be an architectural limitation to perception and unity. Am I right?
User avatar
EisernSchild
Vireio Perception Developer
Vireio Perception Developer
Posts: 225
Joined: Tue Jun 11, 2013 9:39 am
Location: Graz / Austria

Re: Kerbal Space Progam + Oculus Rift shader analyzer quest

Post by EisernSchild »

Anyway, you should still get some vectors in the list. Will try the demo whenever i find time.
Archimid
One Eyed Hopeful
Posts: 10
Joined: Thu Nov 28, 2013 4:44 pm

Re: Kerbal Space Progam + Oculus Rift shader analyzer quest

Post by Archimid »

Hello I'm was re-reading the thread and I forgot to mentions that I did try various permutations of the shader analyzer with exiting the game in game mode. It doesn't write anything to the .csv :( . I also found this link on projection matrices and the Oculus. It really illustrated projection matrices for me. I'm going go looking for the names of the vectors to add. I'll post back if I make some progress.
Post Reply

Return to “Development / General Discussion”