Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 19 Mar 2007
Online Last Active Today, 08:25 AM

#5292655 Shader Node Graph

Posted by Amr0 on 20 May 2016 - 11:23 AM



Do you just categorize this as another "shader permutation" and take an uber shader approach"?


Yes, mostly. If you notice in UE4, the uber shader is represented as a single node, and the user can create a node network to provide inputs for the main uber shader functions. I wrote a short blog post about such a system here. However, I think it doesn't go into enough details to be very useful to you, and also it was just a prototype rather than a real-world solution.

#5292423 Architecture for a C++ Widget Library

Posted by Amr0 on 19 May 2016 - 01:28 AM


The library does not handle drawing by itself. It produces 2D geometry in the form of vertex + index arrays which can be passed by the user to OpenGL or DirectX.


That the library doesn't handle drawing itself is not a bad thing. But instead of being geometry based, why not texture based? Why not asking the client to implement a simple rendering interface, or an entire platform interface for gui event handling/triggering as well as drawing:

class GuiPlatform
	// rendering
	virtual void RenderItem( Rectangle rect, TextureId texture, Rectangle texturePortion ) = 0;
	virtual TextureId LoadTexture( const char* fileName ) = 0;
	// system interaction
	virtual point GetCursorPos() = 0;
	virtual size GetWindowSzie() = 0;
	virtual int HanleEvent( EventType, EventData ) = 0;

bool InitGuiLibrary( GuiPlatform* myGuiPlatform );

Then in your SDK provide sample implementations for DX11, OpenGL, Win32, or whatever.


Edit: Personally I'd name it Open Widget Library (OWL), but that's just me... owls are cool [@v@]

#5290687 Custom editor undo/redo system

Posted by Amr0 on 08 May 2016 - 12:33 PM

In my application (Curver, see signature), I use the third approach. However, it doesn't have to be complicated. For example, to modify the properties of an object, the undoable command class looks like this:

class CmdModifyCurveProperties : public Command
	Curve::Properties m_properties;
	Curve* m_pCurve;
	Execute( Curve& curve )
		m_pCurve = &curve;
		m_properties = curve.properties;
	Undo() { SwitchProperties(); }
	Redo() { SwitchProperties(); }
		Curve::Properties p = m_pCurve->properties;
		m_pCurve->properties = m_properties;
		m_properties = p;

pDocument->AddCommand( (new CmdModifyCurveProperties)->Execute( theCurve ) );
// now we can change the properties however we want and the changes will be
// undone when the command is undone.
theCurve.properties.thickness = 0.5;
theCurve.properties.color = black;

Of course, multiple commands can be grouped together for performing multiple tasks that are to be undone and redone as a unit:

auto cmdGroup = new CommandGroup;
cmdGroup->AddCommand( (new CmdCreateCurve( &theCurve ))->Execute() );
cmdGroup->AddCommand( (new CmdSelectCurve( &theCurve ))->Execute() );
cmdGroup->AddCommand( (new CmdCreateCircle( &theCircle))->Execute() );
cmdGroup->AddCommand( (new CmdSplitCurve( &theCircle, 0.5, &theDetachedPart))->Execute() );
pDocument->AddCommand( cmdGroup );

The approach in Maya seems to be complicated because it is used with scripting as well to implement undoable commands, and the interface is intended for plug-in authors instead of for direct use internally.


But there is no approach that is right for all projects. As Alberth mentioned, you will have to think about of object ownership and guaranteeing existence, so it's not without headaches. Good luck.

#5288413 open source x file format library

Posted by Amr0 on 24 April 2016 - 02:38 AM

The x file format is seemingly deprecated and I recommend you avoid it and move to something else like FBX for example, unless ditching it is not practical for your particular project. You will generally find more support with another format. This thread may be of interest.

#5287726 Native WinAPI Sortable (Button) List Functionality

Posted by Amr0 on 20 April 2016 - 12:56 AM

There is nothing natively available in win32 for this, so you'll have to implement it yourself. May I recommend an alternative GUI library for you that has this functionality and more? Sciter. I've switched from win32 to Sciter and never looked back since then. It's an HTML/JavaScript/CSS engine that is ALSO lightweight and free for commercial and non-commercial use. You can easily setup drag and drop for a button list if you look at the drag-n-drop samples in the SDK.


There is a bit of a learning curve though. One neat characteristic is that you don't have to replace your existing application's GUI completely if your application is not at its development start. You can create Sciter windows in addition to your existing native windows.

p.s: I'm not affiliated with Sciter in any way - I just like it and think it deserves more popularity.

#5287284 Direct3D9 Debugging on windows 10.

Posted by Amr0 on 17 April 2016 - 03:19 AM

If you're developing on NVidia hardware, I think you can still get some useful debugging information from NVidia's PerfHUD or NSight with DX9. Haven't personally tried it yet.

#5287280 Direct3D9 Debugging on windows 10.

Posted by Amr0 on 17 April 2016 - 02:49 AM

I remember reading the DX9 debug runtimes were disabled in Windows 7 SP1 and Windows8, so maybe they are still disabled on Windows 10. See this and this.



Not using DX9 would be a great start.

Only for a new project or a project early in development. Personally my application is nearing release after years of development and I've only recently met with this issue, but switching to DX11 would set me back a few months at least! Thanks but no thanks.

#5276156 VS2015 without internet explorer

Posted by Amr0 on 17 February 2016 - 12:11 PM

If you've already gone through the trouble of installing VS2015, why not also install IE? It's not like you have to use it or anything.

#5276095 Vulkan 1.0

Posted by Amr0 on 17 February 2016 - 01:40 AM

Still having a separate thread to discuss the release is not a bad idea I thithink.

#5272353 Best way to document gamedev progress

Posted by Amr0 on 23 January 2016 - 07:41 AM

I use Workflowy as well to keep track of my progress and planning, but it's for a line-art tool that I try to keep as simple as possible. Here is the project's workflow. I document my progress simply by dragging items from the to-do list to the completed list. But I think you have to decide what exactly you want to document and why. For a one-man team, you have to be careful to balance your time between making actual progress and documenting that progress. I think a simple documentation approach like this is suitable for small and technical progress points, and make a monthly-or-so detailed and well-written blog post to go over what's been done during that month.

#5270250 Want to create a game but can't code, tips appreciated!

Posted by Amr0 on 09 January 2016 - 05:54 AM

You can make a full game in Unreal Engine with all the needed logic and interactions using Blueprints. Blueprints is a great way to program for people who don't want to code. Go ahead and watch a few videos and see if it seems doable to you.

#5267564 Indie Game Company Names

Posted by Amr0 on 22 December 2015 - 05:36 PM

Rose Thorn studios?


Doesn't "studios" imply a company spanning multiple studios? Just curious.

#5267143 How do you organize your time for game dev?

Posted by Amr0 on 20 December 2015 - 08:02 AM

"full time lone wolf game developer". My advice is "don't do that"! Of course, this is assuming that what I'm assuming is true. I'm assuming you don't have another day job, you are 30 (based on your username), you will be working alone, you don't have prior relevant work experience, and you are planning to live off your relatives or off your savings from previous jobs until game development starts paying off. If that's true, then I think it's too risky.


But if you do decide to take the plunge anyway, I would recommend you separate your work place from your residence. The distractions at home are ENDLESS! This also allows you to set a starting and ending time for your work sessions. So every morning you can wake up on time, get dressed, go to the office, and work your ass off. This results in your body releasing a certain dose of "daily adrenaline" that will be effective in keeping you energized for work, as opposed to having your computer next to your sleeping bed and living like a hikikomori... not that I would know anything about that...  *oh god the memories are so vivid*


Also, stay clear from anime and games. For your breaks, choose computer-unrelated activities if you can. And play sports.


As for scheduling, basically you have to work like mad until you have a working and running prototype of whatever it is you are trying to build. After that you can set a plan - what needs to be added/improved/fixed/removed... etc. Personally I find planning from scratch to be ineffective. This plan will be alive and changing as the project progresses.


Also, get some people engaged as soon as possible. Hear from them and report to them your progress.


Good luck!

#5266927 C++ Webpage inside a program

Posted by Amr0 on 18 December 2015 - 12:33 PM


Sciter. It's an HTML/CSS/JavaScript engine. Simple to integrate and powerful to use. Intended for GUI programming and doesn't try to reproduce the functionality and standard compliance as a web browser.


P.s. typing on phone sucks!

Jesus...I'm just trying to make a web page appear in my application window.


You can do that by calling:

SciterLoadFile( hWnd, "file.htm" );

#5266919 C++ Webpage inside a program

Posted by Amr0 on 18 December 2015 - 11:43 AM

Sciter. It's an HTML/CSS/JavaScript engine. Simple to integrate and powerful to use. Intended for GUI programming and doesn't try to reproduce the functionality and standard compliance as a web browser.


P.s. typing on phone sucks!